From 69b15a21176e3e8ef91f9167d39f29cc72ba1143 Mon Sep 17 00:00:00 2001 From: Muhammad Arslan Sajid Date: Mon, 9 Mar 2020 12:36:19 +0100 Subject: [PATCH] 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?" --- content/docs/hooks-faq.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/hooks-faq.md b/content/docs/hooks-faq.md index 85e27b22..e01bb85a 100644 --- a/content/docs/hooks-faq.md +++ b/content/docs/hooks-faq.md @@ -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}