0.0.1 • Published 9 years ago
size-decorator v0.0.1
#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})
0.0.1
9 years ago