Skip to content

jschlieber/react-throttle-render

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Throttle the number of times render() is called.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%