Skip to content

geobde/useRerender

Repository files navigation

React hook to detect component mount, unmount & re-renders.

See Demo

Install

npm i use-is-rerender --save
yarn add use-is-rerender

Usage

import { useRerender } from 'use-is-rerender'

const Button = () => {
  useRerender()
  return <button>Click</button>
}

Available hook options

Option Acceptable Values Details
logProps
  • true (default)
  • false
Can disable props logging

Production mode

Hook not working when NODE_ENV==='production'

Read More

React Performance

Contributors

License

See the LICENSE file for licensing information.

About

React hook to detect component mount, unmount & re-renders.

Resources

License

Stars

Watchers

Forks