Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 833 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 833 Bytes

react-throttle-render

npm version

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(VeryBigRenderComponent, 50)

API

throttle(component, wait[, option]) => wrappedComponent

  • component The source React component
  • wait The number of milliseconds to throttle
  • wrappedComponent The throttled React component
  • option The option for lodash.throttle

License

MIT