do I have to remove <React.StrictMode> before creating build file?

304 Views Asked by At

I want to create build file for my react app, and I don't want components to render in it two time, so do I have to remove <React.StrictMode> before running following command:

npm run build

1

There are 1 best solutions below

0
Galbert On

You don't need to remove React.StrictMode after you use npm run build. React disables the strict modes for your production build.

Although the Strict Mode checks only run in development, they help you find bugs that already exist in your code but can be tricky to reliably reproduce in production. Strict Mode lets you fix bugs before your users report them.

https://react.dev/reference/react/StrictMode