mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-22 20:01:57 +00:00
Add note about StrictMode not as the root component (#7702)
This commit is contained in:
@@ -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.
|
||||
|
||||
<Note>
|
||||
|
||||
When `StrictMode` is enabled for a part of the app, React will only enable behaviors that are possible in production. For example, if `<StrictMode>` 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.
|
||||
|
||||
</Note>
|
||||
|
||||
---
|
||||
|
||||
### Fixing bugs found by double rendering in development {/*fixing-bugs-found-by-double-rendering-in-development*/}
|
||||
|
||||
Reference in New Issue
Block a user