react width provider add clientWidth to your Component props
npm install @beisen/react-width-provider``javascript
import widthProvider from '@beisen/react-width-provider';
@widthProvider('width') //指定存在props中的key,如果不传,侧为width
class MyClass extends React.Component {
render(){
return
export default MyClass
`
使用widthProvider包装过的组件,在this.props.中始终都能获取到自己的宽度
bash
git clone git@gitlab.beisencorp.com:ux-cnpm/ux-react-width-provider.git
cd ux-react-width-provider
npm install
npm run example
`安装
`bash
npm install --save @beisen/react-width-provider
``