You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/reference/react/StrictMode.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ Strict Mode enables the following development-only behaviors:
44
44
45
45
- Your components will [re-render an extra time](#fixing-bugs-found-by-double-rendering-in-development) to find bugs caused by impure rendering.
46
46
- Your components will [re-run Effects an extra time](#fixing-bugs-found-by-re-running-effects-in-development) to find bugs caused by missing Effect cleanup.
47
-
- <CanaryBadgetitle="This feature is only available in the Canary channel" /> Your components will [detach and re-attach DOM refs](#fixing-bugs-found-by-cleaning-up-and-re-attaching-dom-refs-in-development) to find bugs caused by missing DOM ref cleanup.
47
+
- <CanaryBadgetitle="This feature is only available in the Canary channel" /> Your components will [detach and re-attach refs to components](#fixing-bugs-found-by-cleaning-up-and-re-attaching-dom-refs-in-development) to find bugs caused by missing ref cleanup.
48
48
- Your components will [be checked for usage of deprecated APIs.](#fixing-deprecation-warnings-enabled-by-strict-mode)
49
49
50
50
#### Props {/*props*/}
@@ -88,7 +88,7 @@ Strict Mode enables the following checks in development:
88
88
89
89
- Your components will [re-render an extra time](#fixing-bugs-found-by-double-rendering-in-development) to find bugs caused by impure rendering.
90
90
- Your components will [re-run Effects an extra time](#fixing-bugs-found-by-re-running-effects-in-development) to find bugs caused by missing Effect cleanup.
91
-
- <CanaryBadgetitle="This feature is only available in the Canary channel" /> Your components will [detach and re-attach DOM refs](#fixing-bugs-found-by-cleaning-up-and-re-attaching-dom-refs-in-development) to find bugs caused by missing DOM ref cleanup.
91
+
- <CanaryBadgetitle="This feature is only available in the Canary channel" /> Your components will [detach and re-attach refs to components](#fixing-bugs-found-by-cleaning-up-and-re-attaching-dom-refs-in-development) to find bugs caused by missing ref cleanup.
92
92
- Your components will [be checked for usage of deprecated APIs.](#fixing-deprecation-warnings-enabled-by-strict-mode)
93
93
94
94
**All of these checks are development-only and do not impact the production build.**
@@ -827,16 +827,16 @@ Without Strict Mode, it was easy to miss that your Effect needed cleanup. By run
827
827
[Read more about implementing Effect cleanup.](/learn/synchronizing-with-effects#how-to-handle-the-effect-firing-twice-in-development)
828
828
829
829
---
830
-
### Fixing bugs found by detaching and re-attaching DOM refs in development {/*fixing-bugs-found-by-cleaning-up-and-re-attaching-dom-refs-in-development*/}
830
+
### Fixing bugs found by detaching and re-attaching refs to components in development {/*fixing-bugs-found-by-cleaning-up-and-re-attaching-dom-refs-in-development*/}
831
831
832
832
<Canary>
833
-
In canary and experimental channels, React will run an extra setup+cleanup cycle in development for DOM refs, much like it does for Effects.
833
+
In canary and experimental channels, React will run an extra setup+cleanup cycle in development for refs to components, much like it does for Effects.
834
834
835
-
React will detach DOM refs that were created via `useRef` by setting `ref.current` to `null` before setting it back to the DOM node.
835
+
React will detach refs to components that were created via `useRef` by setting `ref.current` to `null` before setting it to the DOM node or handle.
836
836
837
-
For [`ref` callbacks](/reference/react-dom/components/common#ref-callback), React will call the callback function with the DOM node as its argument. It will then call the callback's [cleanup function](reference/react-dom/components/common#returns) before calling the `ref` callback function again with the DOM node as its argument.
837
+
For [`ref` callbacks](/reference/react-dom/components/common#ref-callback), React will call the callback function with the DOM node or handle as its argument. It will then call the callback's [cleanup function](reference/react-dom/components/common#returns) before calling the `ref` callback function again with the DOM node as its argument.
838
838
839
-
You can read more about DOM refs in [Manipulating the DOM with Refs.](/learn/manipulating-the-dom-with-refs)
839
+
You can read more about refs in [Manipulating the DOM with Refs.](/learn/manipulating-the-dom-with-refs)
0 commit comments