mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-26 07:25:20 +00:00
removed old "early time for hooks" note (#4321)
This commit is contained in:
@@ -97,8 +97,6 @@ You can't use Hooks *inside* a class component, but you can definitely mix class
|
||||
|
||||
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.
|
||||
|
||||
### Do Hooks replace render props and higher-order components? {#do-hooks-replace-render-props-and-higher-order-components}
|
||||
|
||||
Often, render props and higher-order components render only a single child. We think Hooks are a simpler way to serve this use case. There is still a place for both patterns (for example, a virtual scroller component might have a `renderItem` prop, or a visual container component might have its own DOM structure). But in most cases, Hooks will be sufficient and can help reduce nesting in your tree.
|
||||
|
||||
Reference in New Issue
Block a user