lbc-wrapper

2.0.0 • Public • Published

LB-COMPONENT-WRAPPER

1.0.0 is developed via TypeScript

公共组件的包装层,现在是包装antd

yarn add lbc-wrapper # npm install 

因为antd在很多时候并没有写shouldComponentUpdate,所以导致性能不高。

通过包装层,添加shouldComponentUpdate实现,减少不必要的渲染,提高效率

Example

每一个antd的组件,都通过import ANTD_NAME from 'lbc-wrapper/lib/antd_name'导入。 如果antd的组件包含子组件,如Select的Option,则需要使用import { Option } from 'lbc-wrapper/lib/select'来导入

// used to
import { Button, Select, Table } from 'antd'
const { Option } = Select
 
// right now
import Button from 'lbc-wrapper/lib/button'
import Select, { Option } from 'lbc-wrapper/lib/select'
import Table from 'lbc-wrapper/lib/table'

1.0.11和@types/react@16.7.17正常工作

Readme

Keywords

Package Sidebar

Install

npm i lbc-wrapper

Weekly Downloads

2

Version

2.0.0

License

ISC

Unpacked Size

101 kB

Total Files

201

Last publish

Collaborators

  • loongblockfrontend