2.0.0 • Published 6 years ago

react-on-looker v2.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

react-on-looker

A simple React component to manage window size event and side effects for them.

API

Render Prop

Render prop version of this API.

import OnLooker from 'react-on-looker';

class MyComponent extends React.Component {
  return (
    <OnLooker>
      {({ width, height, isResizing }) => {
        if(isResizing) {
          return <h1>Currently Resizing...</h1>
        }
        return <h1>{width} x {height} </h1>;
      }}
    </OnLooker>
  )
}

Props

children: (looker: OnLookerState) => React.ReactNode;
delay: number;
2.0.0

6 years ago