Skip to content
React HOC that passes browser window size to wrapped component
Branch: master
Clone or download
Latest commit e70192b Sep 6, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
scripts
src
.babelrc init Feb 8, 2017
.eslintrc init Feb 8, 2017
.gitignore
.npmignore init Feb 8, 2017
LICENSE
README.md
index.js
package-lock.json v1.2.0 - getWrappedInstance method May 4, 2018
package.json

README.md

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);
You can’t perform that action at this time.