2.0.0 • Published 9 years ago
react-throttle-render v2.0.0
react-throttle-render
Throttle the number of times render() is called.
Description
It may enhance the performance under the following conditions.
- The component receives new props frequently.
- The component has a huge or slow
render().
Installation
npm i --save react-throttle-render
Usage
import throttle from 'react-throttle-render'
const ThrottledComponent = throttle(50)(VeryBigRenderComponent)API
throttle(wait[, option]) => component => wrappedComponent
waitThe number of milliseconds to throttleoptionThe option for lodash.throttlecomponentThe source React componentwrappedComponentThe throttled React component
License
MIT