Browse Source

Fix typo in hooks-faq.md (#2649)

* Fix typo in hooks-faq.md

* Update hooks-faq.md

* Update hooks-faq.md

Co-authored-by: Sophie Alpert <git@sophiebits.com>
Co-authored-by: Sunil Pai <threepointone@oculus.com>
main
mknapper1 5 years ago
committed by GitHub
parent
commit
fe5ec2c55d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      content/docs/hooks-faq.md

2
content/docs/hooks-faq.md

@ -580,7 +580,7 @@ Depending on your use case, there are a few more options described below.
Let's see why this matters.
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 used inside that participate in the React data flow. That includes props, state, and anything derived from them.
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.
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:

Loading…
Cancel
Save