React component to detect window size change
npm install react-window-detect-dimensions``sh`
$ npm install --save react-window-detect-dimensions
`js`
class DimensionDemo extends React.Component<{}> {
render() {
return (
{ ({ windowWidth, windowHeight }) => (
width: {windowWidth}, // get window width
height: {windowHeight} // get window height
)}
);
}
}
``
npm start
`js``
npm run gh-pages
MIT © [chilijung]()
[npm-image]: https://badge.fury.io/js/react-window-detect-dimensions.svg
[npm-url]: https://npmjs.org/package/react-window-detect-dimensions
[travis-image]: https://travis-ci.org/Canner/react-window-detect-dimensions.svg?branch=master
[travis-url]: https://travis-ci.org/Canner/react-window-detect-dimensions
[daviddm-image]: https://david-dm.org/Canner/react-window-detect-dimensions.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/Canner/react-window-detect-dimensions