https://github.com/finnfiddle/react-window-size
React HOC that passes browser window size to wrapped component
https://github.com/finnfiddle/react-window-size
Last synced: 10 months ago
JSON representation
React HOC that passes browser window size to wrapped component
- Host: GitHub
- URL: https://github.com/finnfiddle/react-window-size
- Owner: finnfiddle
- License: mit
- Created: 2017-02-08T20:30:19.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T02:31:08.000Z (over 3 years ago)
- Last Synced: 2025-07-27T11:48:47.839Z (11 months ago)
- Language: JavaScript
- Size: 140 KB
- Stars: 36
- Watchers: 2
- Forks: 14
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# React Window Size
A higher-order React component that passes the browser window's dimensions as props to the wrapped component.
Example:
```javascript
import React, { Component } from 'react';
import windowSize from 'react-window-size';
class ScreenSize extends Component {
render() {
return (
Screen width is: {this.props.windowWidth}
Screen height is: {this.props.windowHeight}
);
}
}
export default windowSize(ScreenSize);
```