npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

wbyui

v2.0.0-beta.0

Published

---- 针对React技术栈维护的前端组件库。

Downloads

77

Readme

wbyui


针对React技术栈维护的前端组件库。

组件


  • WBYTableFooter
  • WBYUploadFile
  • WBYDetailTable
  • HOCReactComponent
  • ExtendReactComponent

changelog

[email protected]

  1. 增加HOCReactComponent
  2. ExtendReactComponent

组件使用方式


HOCReactComponent

组件应用场景

由于在React项目开发中,由于React本身渲染制度决定,导致父组件中传入子组件的属性在没有任何修改的时候,就会发生一次渲染。这样无形中导致了Diff算法的时间和空间成本。所以会利用React本身的生命周期(shouldComponentUpdate)利用Lodash.js(现在项目中暂时没有用到Immutable.js)来控制这类行为的发生,但是发现如果每次在组件内部进行处理,发现有很多冗余的代码。所以在某处来统一处理。发现React的HOC可以实现该效果。

组件使用

  1. 组件的导入(需要更新最新的[email protected])
import {HOCReactComponent} from 'wbyui';

2.处理组件(在组件调用出使用)

import {HOCReactComponent} from 'wbyui';
import {ExampleComponent} from 'yourStoreComponentsFile'
const ExampleComponent = HOCReactComponent(ExampleComponent);
class App extends React.Component {
    //...
    render(){
        return(
            <div>
                <HOCExampleComponent/>
            </div>
        )
    }
}

ExtendReactComponent


组件使用

  1. 组件的导入(需要更新最新的[email protected])
import {ExtendReactComponent} from 'wbyui';
  1. 处理组件(在组件定义处使用)
import {ExtendReactComponent} from 'wbyui';

export default class ExampleComponent extends ExtendReactComponent {
    //...
    render(){
        return(
            <div>
                <span>
                    ExampleComponent的内部实现
                </span>
            </div>
        )
    }
}