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: beta/src/pages/apis/useref.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,9 +63,9 @@ function handleStopClick() {
63
63
64
64
By using a ref, you ensure that:
65
65
66
-
- You can **store information** between re-renders. (Unlike regular variables, which reset on every render.)
67
-
- Changing it **does not trigger a re-render**. (Unlike state variables, which trigger a re-render.)
68
-
- The **information is local** to each copy of your component. (Unlike the variables outside, which are shared.)
66
+
- You can **store information** between re-renders (unlike regular variables, which reset on every render).
67
+
- Changing it **does not trigger a re-render** (unlike state variables, which trigger a re-render).
68
+
- The **information is local** to each copy of your component (unlike the variables outside, which are shared).
69
69
70
70
Changing a ref does not trigger a re-render, so refs are not appropriate for storing information that you want to display on the screen. Use state for that instead. Read more about [choosing between `useRef` and `useState`](/learn/referencing-values-with-refs#differences-between-refs-and-state).
0 commit comments