npm.io
1.2.2 • Published 8 years ago

react-window-size

Licence
MIT
Version
1.2.2
Deps
1
Size
12 kB
Vulns
0
Weekly
0
Stars
35

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);

Keywords