3

I was reading the doc and learned that React StrictMode is for development only, and it explains why we have double invoke.

That's great, but does it mean I have to disable the StrictMode manualy for my production, or does react build command does it on its own?

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
Johan
  • 2,088
  • 2
  • 9
  • 37

1 Answers1

2

Stright from the Beta docs:

Strict Mode enables the following checks in development:

  • Your components will re-render an extra time to find bugs caused by impure rendering.
  • Your components will re-run Effects an extra time to find bugs caused by missing Effect cleanup.
  • Your components will be checked for usage of deprecated APIs.

All of these checks are development-only and do not impact the production build.

Enfield Li
  • 1,952
  • 1
  • 8
  • 23