iamjoshellis / react-window-bigness

Performantly pass window dimensions as props! πŸ“

Home Page:https://react-window-bigness.netlify.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Window Bigness πŸ“

npm Build Status code style: prettier Netlify Status Greenkeeper badge

Performantly pass window dimensions as props! πŸ“

Render Props Usage:

import * as React from 'react';
import { WindowSize } from 'react-window-bigness';

const MyComponent = () => (
  <WindowSize>
    {({ windowWidth, windowHeight }) => JSON.stringify({ windowWidth, windowHeight })}
  </WindowSize>
);

export default MyComponent;

HOC Usage:

import * as React from 'react';
import { withWindowSize } from 'react-window-bigness';

const MyComponent = ({ windowWidth, windowHeight }) => (
  JSON.stringify({ windowWidth, windowHeight })
);

export default withWindowSize(MyComponent);

About

Performantly pass window dimensions as props! πŸ“

https://react-window-bigness.netlify.com/

License:MIT License


Languages

Language:TypeScript 100.0%