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