frc-auto-size
v1.0.1
Published
react component auto size
Downloads
1
Readme
react component auto size
安装
npm install frc-auto-size --save-dev
Props
| props | describe | type | default value | | ----------------- | --------------------- | --------------------------------------- | ------------- | | className | className | String | | | defaultWidth | default width | Number | | | defaultHeight | default height | Number | | | disableWidth | disable width | Boolean | false | | disableHeight | disable height | Boolean | false | | style | style | Style | | | onResize | listen resize | Function | - | | children | render children | Function | |
示例
import React from 'react';
import AutoSize from 'frc-auto-size';
class Demo extends React.Component {
render() {
return (
<AutoSize checked={true}>{function({width, height}) {
return (<div style={{width, height}}></div>)
}}</AutoSize>
);
}
}