Little resize listener component
import React from 'react'
import Resize, {Breakpoint} from '@tiaanduplessis/react-resize'
const Example = () => {
return <main>
<Resize>{
({ width, height }) => <div>{width} - {height}</div>
}</Resize>
<Breakpoint minWidth={500}>
<h1>Hi</h1>
</Breakpoint>
</main>
}
export default Example
This project uses node and npm.
$ npm install @tiaanduplessis/react-resize
$ # OR
$ yarn add @tiaanduplessis/react-resize
- Fork it and create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am "Add some feature"
- Push to the branch:
git push origin my-new-feature
- Submit a pull request
MIT © Tiaan du Plessis