FaCC that re-renders on window size change.
import {WindowSizeSensor} from 'libreact/lib/WindowSizeSensor';
<WindowSizeSensor>{({width, height}) =>
`width: ${width}, height: ${height}`
}</WindowSizeSensor>
You can use it without children.
<WindowSizeSensor onChange={({width, height}) => console.log(width, height)} />
HOC that merges windowSize
prop into enhanced component's props.
import {withWindowSize} from 'libreact/lib/WindowSizeSensor';
React stateful component decorator that adds windowSize
prop.
import {withWindowSize} from 'libreact/lib/WindowSizeSensor';
@withWindowSize
class MyComp extends Component {
}