From abb5831d89a6407bcf7821ea86eefe9c980b8138 Mon Sep 17 00:00:00 2001 From: Rick Hanlon Date: Mon, 31 Mar 2025 11:56:24 -0400 Subject: [PATCH] Add note about StrictMode not as the root component --- src/content/reference/react/StrictMode.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/content/reference/react/StrictMode.md b/src/content/reference/react/StrictMode.md index 5b62794bcf6..d620fcc980f 100644 --- a/src/content/reference/react/StrictMode.md +++ b/src/content/reference/react/StrictMode.md @@ -122,6 +122,12 @@ function App() { In this example, Strict Mode checks will not run against the `Header` and `Footer` components. However, they will run on `Sidebar` and `Content`, as well as all of the components inside them, no matter how deep. + + +When `StrictMode` is enabled for a part of the app, React will only enable behaviors that are possible in production. For example, if `` is not enabled at the root of the app, it will not [re-run Effects an extra time](#fixing-bugs-found-by-cleaning-up-and-re-attaching-dom-refs-in-development) on initial mount, since this would cause child effects to double fire without the parent effects, which cannot happen in production. + + + --- ### Fixing bugs found by double rendering in development {/*fixing-bugs-found-by-double-rendering-in-development*/}