React HOC that passes browser window size to wrapped component
Switch branches/tags
Nothing to show
Clone or download
finnfiddle Merge branch 'master' of
* 'master' of
  Fix double render
Latest commit 8d834a9 May 4, 2018

React Window Size

A higher-order React component that passes the browser window's dimensions as props to the wrapped component.


import React, { Component } from 'react';
import windowSize from 'react-window-size';

class ScreenSize extends Component {

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


export default windowSize(ScreenSize);