0

I've found Why is my React component is rendering twice? which fixed my coding error (setState getting called X times depending in which component it gets called), but do I have a problem with my code now if removing React.StrictMode solved it?

Someone wrote:

This happens is an intentional feature of the React.StrictMode. It only happens in development mode and should help to find accidental side effects in the render phase.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
Cinc-B
  • 121
  • 2
  • 9
  • Yes if you had a bug that got solved by removing strict mode, it's still a bug. Rendering multiple times is by design, let React do that. – Evert Feb 05 '23 at 15:40
  • If Removing Strict mode solved your issue, that is a warning that you will have those bugs in production (real-world usage). So, you should fix your code in such a way that the bugs do not appear even in development. – Shivam Jha Feb 05 '23 at 16:09

0 Answers0