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: content/docs/hooks-faq.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -304,7 +304,7 @@ This might look strange at first, but an update during rendering is exactly what
304
304
305
305
### Can I make a ref to a function component?
306
306
307
-
While you shouldn't need this often, you may expose some imperative methods to a parent component with the [`useImperativeMethods`](/docs/hooks-reference.html#useimperativemethods) Hook.
307
+
While you shouldn't need this often, you may expose some imperative methods to a parent component with the [`useImperativeHandle`](/docs/hooks-reference.html#useimperativehandle) Hook.
308
308
309
309
### What does `const [thing, setThing] = useState()` mean?
Copy file name to clipboardexpand all lines: content/docs/hooks-reference.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ If you're new to Hooks, you might want to check out [the overview](/docs/hooks-o
21
21
-[`useCallback`](#usecallback)
22
22
-[`useMemo`](#usememo)
23
23
-[`useRef`](#useref)
24
-
-[`useImperativeMethods`](#useimperativemethods)
24
+
-[`useImperativeHandle`](#useimperativehandle)
25
25
-[`useLayoutEffect`](#uselayouteffect)
26
26
-[`useDebugValue`](#usedebugvalue)
27
27
@@ -322,18 +322,18 @@ function TextInputWithFocusButton() {
322
322
323
323
Note that `useRef()` is useful for more than the `ref` attribute. It's [handy for keeping any mutable value around](/docs/hooks-faq.html#is-there-something-like-instance-variables) similar to how you'd use instance fields in classes.
`useImperativeMethods` customizes the instance value that is exposed to parent components when using `ref`. As always, imperative code using refs should be avoided in most cases. `useImperativeMethods` should be used with `forwardRef`:
331
+
`useImperativeHandle` customizes the instance value that is exposed to parent components when using `ref`. As always, imperative code using refs should be avoided in most cases. `useImperativeHandle` should be used with `forwardRef`:
0 commit comments