1.1.0 • Published 9 years ago
react-throttle-props v1.1.0
react-throttle-props
Throttle the number of times a component receives new props not to call render() too many times.
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-props
Usage
import throttle from 'react-throttle-props'
const ThrottledComponent = throttle(VeryBigRenderComponent, 50)API
throttle(component, wait) => wrappedComponent
componentThe source React componentwaitThe number of milliseconds to throttlewrappedComponentThe throttled React component
License
MIT