h.notes

Home

❯

Explorations

❯

useReducer()

useReducer()

Feb 03, 20251 min read

I wish I knew this before! This wasted a lot of my time!! https://react.dev/reference/react/useReducer#caveats

In Strict Mode, React will call your reducer and initializer twice in order to help you find accidental impurities. This is development-only behavior and does not affect production. If your reducer and initializer are pure (as they should be), this should not affect your logic. The result from one of the calls is ignored.


Graph View

Backlinks

  • No backlinks found

by Hursh Gupta.

  • Portfolio
  • GitHub
  • LinkedIn