Skip to content

Commit 69b15a2

Browse files
authored
update hooks-faq.md (#2806)
1- Added getDerivedStateFromError lifecycle method to "Do Hooks cover all use cases for classes?" 2- Added getSnapshotBeforeUpdate lifecycle method to "How do lifecycle methods correspond to Hooks?"
1 parent aa17708 commit 69b15a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/docs/hooks-faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ You can't use Hooks *inside* of a class component, but you can definitely mix cl
9595

9696
### Do Hooks cover all use cases for classes? {#do-hooks-cover-all-use-cases-for-classes}
9797

98-
Our goal is for Hooks to cover all use cases for classes as soon as possible. There are no Hook equivalents to the uncommon `getSnapshotBeforeUpdate` and `componentDidCatch` lifecycles yet, but we plan to add them soon.
98+
Our goal is for Hooks to cover all use cases for classes as soon as possible. There are no Hook equivalents to the uncommon `getSnapshotBeforeUpdate`, `getDerivedStateFromError` and `componentDidCatch` lifecycles yet, but we plan to add them soon.
9999

100100
It is an early time for Hooks, and some third-party libraries might not be compatible with Hooks at the moment.
101101

@@ -218,7 +218,7 @@ There are a few more heuristics, and they might change over time as we fine-tune
218218

219219
* `componentDidMount`, `componentDidUpdate`, `componentWillUnmount`: The [`useEffect` Hook](/docs/hooks-reference.html#useeffect) can express all combinations of these (including [less](#can-i-skip-an-effect-on-updates) [common](#can-i-run-an-effect-only-on-updates) cases).
220220

221-
* `componentDidCatch` and `getDerivedStateFromError`: There are no Hook equivalents for these methods yet, but they will be added soon.
221+
* `getSnapshotBeforeUpdate`, `componentDidCatch` and `getDerivedStateFromError`: There are no Hook equivalents for these methods yet, but they will be added soon.
222222

223223
### How can I do data fetching with Hooks? {#how-can-i-do-data-fetching-with-hooks}
224224

0 commit comments

Comments
 (0)