0.1.1 • Published 5 years ago
react-window-bigness v0.1.1
React Window Bigness 📏
Performantly pass window dimensions as props! 📐
Demo
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);