Browse Source

docs: fix incomplete sentences in useref.md (#4731)

main
Jake Boone 3 years ago
committed by GitHub
parent
commit
6240fed568
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      beta/src/pages/apis/useref.md

6
beta/src/pages/apis/useref.md

@ -63,9 +63,9 @@ function handleStopClick() {
By using a ref, you ensure that:
- You can **store information** between re-renders. (Unlike regular variables, which reset on every render.)
- Changing it **does not trigger a re-render**. (Unlike state variables, which trigger a re-render.)
- The **information is local** to each copy of your component. (Unlike the variables outside, which are shared.)
- You can **store information** between re-renders (unlike regular variables, which reset on every render).
- Changing it **does not trigger a re-render** (unlike state variables, which trigger a re-render).
- The **information is local** to each copy of your component (unlike the variables outside, which are shared).
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).

Loading…
Cancel
Save