Skip to content

iamjoshellis/react-window-bigness

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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! ๐Ÿ“

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published