react-window-detect-dimensions
v0.2.0
Published
React component to detect window size change
Downloads
320
Readme
react-window-detect-dimensions
React component to detect window size change
Installation
$ npm install --save react-window-detect-dimensions
Usage
class DimensionDemo extends React.Component<{}> {
render() {
return (
<WindowDimensions>
{ ({ windowWidth, windowHeight }) => (
<div>
width: {windowWidth}, // get window width
height: {windowHeight} // get window height
</div>
)}
</WindowDimensions>
);
}
}
Start example server
npm start
generate demo
npm run gh-pages
License
MIT © chilijung