useDidUpdate

Run an effect only when the dependencies change, not on the first render.

This is custom React hooks, you need to follow the Basic Rules when you use it.

General

The counter of updates ignores the first render.

APIs

useDidUpdate

const useDidUpdate = (
  fn: EffectCallback,
  dependencies?: DependencyList,
) => void
Edit this page on GitHub