Skip to content

Commit f058d35

Browse files
Sunil Paigaearon
Sunil Pai
andauthored
Update content/docs/hooks-faq.md
Co-Authored-By: gaearon <dan.abramov@gmail.com>
1 parent 4c61b2f commit f058d35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

content/docs/hooks-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ function MeasureExample() {
475475
}
476476
```
477477

478-
We didn't choose `useRef` in this example because an object ref doesn't notify us about *changes* to the current ref value. Using a *callback ref* ensures that [even if a child component displays the measured node later](https://codesandbox.io/s/818zzk8m78) (e.g. in response to a click), we still get notified about it in the parent component and can update the measurements.
478+
We didn't choose `useRef` in this example because an object ref doesn't notify us about *changes* to the current ref value. Using a callback ref ensures that [even if a child component displays the measured node later](https://codesandbox.io/s/818zzk8m78) (e.g. in response to a click), we still get notified about it in the parent component and can update the measurements.
479479

480480
Note that we pass `[]` as a dependency array to `useCallback`. This ensures that our ref callback doesn't change between the re-renders, and so React won't call it unnecessarily.
481481

0 commit comments

Comments
 (0)