README
react size decorator,
adds width and height props to component (also recalculates this props on resize)
install
npm install --save size-decorator
usage
import size from 'size-decorator';
@size()
export default class MySuperComponent extends Component {
constructor(props) {
super(props);
}
render() {
console.log(this.props.width, this.props.height)
return (<div style={{width: 100, height: 100}}>HELLO</div>);
}
}
or if you want width and height parameters on server
@size({width: 100, height: 200})