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?"
@ -95,7 +95,7 @@ You can't use Hooks *inside* of a class component, but you can definitely mix cl
### Do Hooks cover all use cases for classes? {#do-hooks-cover-all-use-cases-for-classes}
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.
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.
It is an early time for Hooks, and some third-party libraries might not be compatible with Hooks at the moment.
@ -218,7 +218,7 @@ There are a few more heuristics, and they might change over time as we fine-tune
* `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).
* `componentDidCatch` and `getDerivedStateFromError`: There are no Hook equivalents for these methods yet, but they will be added soon.
* `getSnapshotBeforeUpdate`, `componentDidCatch` and `getDerivedStateFromError`: There are no Hook equivalents for these methods yet, but they will be added soon.
### How can I do data fetching with Hooks? {#how-can-i-do-data-fetching-with-hooks}