Package Exports
- react-throttle-render
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-throttle-render) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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
wait
The number of milliseconds to throttleoption
The option for lodash.throttlecomponent
The source React componentwrappedComponent
The throttled React component
License
MIT