Wondering what’s next for npm?Check out our public roadmap! »

    react-throttle-render

    2.0.0 • Public • Published

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

    API

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

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

    License

    MIT

    Install

    npm i react-throttle-render

    DownloadsWeekly Downloads

    374

    Version

    2.0.0

    License

    MIT

    Last publish

    Collaborators

    • avatar