react-window-size

React HOC that passes browser window size to wrapped component

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
react-window-size
1.2.26 years ago7 years agoMinified + gzip package size for react-window-size in KB

Readme

React Window Size
A higher-order React component that passes the browser window's dimensions as props to the wrapped component.
Example:
import React, { Component } from 'react';
import windowSize from 'react-window-size';

class ScreenSize extends Component {

  render() {
    return (
      <p>
        Screen width is: {this.props.windowWidth}
        <br />
        Screen height is: {this.props.windowHeight}
      </p>
    );
  }

}

export default windowSize(ScreenSize);