Skip to content

Notify a component in react when the document.body is resized

Notifications You must be signed in to change notification settings

hanford/react-resize-width

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-resize-width

Be notified when the value of the document.body changes efficiently with one event listener


Install

$ npm install react-resize-width --save

Usage

import ResizeWidth from 'react-resize-width'

render () {
  return (
    <ResizeWidth
      onResize={this.handleResize}
    />
  )
}

API

Param Type args required
onResize Function value, event true
parentElement ref null false

MIT © Jack Hanford

About

Notify a component in react when the document.body is resized

Resources

Stars

Watchers

Forks

Packages

No packages published