Skip to content

Commit f673d85

Browse files
authored
Add useLayoutEffect to those hooks with deps (#3232)
1 parent 39f09d6 commit f673d85

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
@@ -580,7 +580,7 @@ Depending on your use case, there are a few more options described below.
580580
581581
Let's see why this matters.
582582

583-
If you specify a [list of dependencies](/docs/hooks-reference.html#conditionally-firing-an-effect) as the last argument to `useEffect`, `useMemo`, `useCallback`, or `useImperativeHandle`, it must include all values that are used inside the callback and participate in the React data flow. That includes props, state, and anything derived from them.
583+
If you specify a [list of dependencies](/docs/hooks-reference.html#conditionally-firing-an-effect) as the last argument to `useEffect`, `useLayoutEffect`, `useMemo`, `useCallback`, or `useImperativeHandle`, it must include all values that are used inside the callback and participate in the React data flow. That includes props, state, and anything derived from them.
584584

585585
It is **only** safe to omit a function from the dependency list if nothing in it (or the functions called by it) references props, state, or values derived from them. This example has a bug:
586586

0 commit comments

Comments
 (0)