WindowSizeSensor
FaCC that re-renders on window size change.
Example
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)} />
withWindowSize()
HOC
HOC that merges windowSize
prop into enhanced component's props.
import {withWindowSize} from 'libreact/lib/WindowSizeSensor';
@withWindowSize
decorator
React stateful component decorator that adds windowSize
prop.
import {withWindowSize} from 'libreact/lib/WindowSizeSensor';
@withWindowSize
class MyComp extends Component {
}