|
17 | 17 | - [Animating the clap count](#animating-the-clap-count)
|
18 | 18 | - [Creating animated bursts!](#creating-animated-bursts)
|
19 | 19 | - [**Section 3: Custom Hooks: The first Foundational Pattern**](#section-3-custom-hooks-the-first-foundational-pattern)
|
| 20 | + - [New to hooks?](#new-to-hooks) |
| 21 | + - [Introduction to Custom Hooks](#introduction-to-custom-hooks) |
20 | 22 | - [Building an animation custom hook](#building-an-animation-custom-hook)
|
21 | 23 | - [Custom hooks and refs](#custom-hooks-and-refs)
|
22 | 24 | - [When is my hook invoked?](#when-is-my-hook-invoked)
|
@@ -571,6 +573,33 @@ const withClapAnimation = WrappedComponent => {
|
571 | 573 |
|
572 | 574 | ## **Section 3: Custom Hooks: The first Foundational Pattern**
|
573 | 575 |
|
| 576 | +### New to hooks? |
| 577 | +
|
| 578 | +- [Hooks API Reference](https://reactjs.org/docs/hooks-reference.html) |
| 579 | +
|
| 580 | +Basic Hooks |
| 581 | +- [Using the State Hook](https://reactjs.org/docs/hooks-state.html) |
| 582 | +- [Using the Effect Hook](https://reactjs.org/docs/hooks-effect.html) |
| 583 | +- [useContext](https://reactjs.org/docs/hooks-reference.html#usecontext) |
| 584 | +
|
| 585 | +Additional Hooks |
| 586 | +- [useCallback](https://reactjs.org/docs/hooks-reference.html#usecallback) |
| 587 | +- [useMemo](https://reactjs.org/docs/hooks-reference.html#usememo) |
| 588 | +- [useRef](https://reactjs.org/docs/hooks-reference.html#useref) |
| 589 | +- [useLayoutEffect](https://reactjs.org/docs/hooks-reference.html#uselayouteffect) |
| 590 | +
|
| 591 | +How do lifecycle methods correspond to Hooks? |
| 592 | +- constructor: Function components don’t need a constructor. You can initialize the state in the useState call. If computing the initial state is expensive, you can pass a function to useState. |
| 593 | +- getDerivedStateFromProps: Schedule an update while rendering instead. |
| 594 | +- shouldComponentUpdate: See React.memo below. |
| 595 | +- render: This is the function component body itself. |
| 596 | +- componentDidMount, componentDidUpdate, componentWillUnmount: The useEffect Hook can express all combinations of these (including less common cases). |
| 597 | +- getSnapshotBeforeUpdate, componentDidCatch and getDerivedStateFromError: There are no Hook equivalents for these methods yet, but they will be added soon. |
| 598 | +
|
| 599 | +**[⬆ back to top](#table-of-contents)** |
| 600 | +
|
| 601 | +### [Introduction to Custom Hooks](https://reactjs.org/docs/hooks-custom.html) |
| 602 | +
|
574 | 603 | Custom Hooks are a mechanism to reuse stateful logic
|
575 | 604 |
|
576 | 605 | ```javascript
|
|
0 commit comments