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
const ThrottledComponent = VeryBigRenderComponent
API
throttle(wait[, option]) => component => wrappedComponent
wait
The number of milliseconds to throttleoption
The option for lodash.throttlecomponent
The source React componentwrappedComponent
The throttled React component
License
MIT