use-rerender2
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

npm version Downloads

use-rerender2

If you need this hook, you're probably doing something wrong. But anyway, here it is.

Returns a function that causes the current component to be rerendered (using setState).

The function is memoized with useCallback.

Usage

import { useRerender } from 'use-rerender2';

const rerender = useRerender();
// . . .
rerender();

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i use-rerender2

    Weekly Downloads

    1

    Version

    1.0.2

    License

    ISC

    Unpacked Size

    2.78 kB

    Total Files

    5

    Last publish

    Collaborators

    • ts-web