I was reading this decorators and fount the @withViewPort usage as :
import React from 'react';
import withViewport from 'react-decorators/withViewport';
@withViewport
class MyComponent {
render() {
let { width, height } = this.props.viewport;
retu <div>Viewport: {width + 'x' + height}</div>;
}
}
React.render(<MyComponent />, document.body);
How does this work @withViewPort decorator work? Does it have state and these state changes while resizing the window size?
