Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

9
  • 24
    The docs reference the intentional "double invoking" in Dev mode: "Strict mode can’t automatically detect side effects for you, but it can help you spot them by making them a little more deterministic. This is done by intentionally double-invoking the following functions" Commented Oct 21, 2021 at 3:09
  • 1
    Had an event listener invoked twice and was wondering why. Seems the strict mode was the cause. Thx! Commented Jul 21, 2022 at 13:13
  • 28
    For Next.js devs, you can disable it by setting "reactStrictMode: false" in next.config.js file. Commented Sep 19, 2022 at 21:13
  • 10
    StrictMode should be removed as a last solution. For a more detailed answer see stackoverflow.com/questions/72238175/…. Commented Oct 28, 2022 at 12:59
  • 4
    Here is the relevant part of React docs: react.dev/learn/… Commented Apr 1, 2023 at 23:03