Summary: Hooks

Here's a quick summary of what we learned in this chapter.

We'll cover the following

What have we learned?

This chapter started with a brief introduction to Hooks in React Native, and we learned about Hooks and why we use them. We also learned about rules and types of Hooks.

We then moved on to discuss each type of Hook and its functionality in detail. We briefly discussed the following Hooks:

  • useState

  • useEffect

  • useContext

  • useReducer

  • useCallback

  • useMemo

  • useRef

We also learned:

  • How to implement and track stateful logic inside functional components.

  • How to perform side effects inside functional components.

  • How to manage states globally by avoiding prop drilling.

  • How to manage states globally by separating the state management logic from the rendering logic.

  • How to optimize the performance of the application by caching functions and their return values.

  • How to persist values between renders of a component.

Finally, we tested our concepts by practically applying them inside coding playgrounds.

Get hands-on with 1200+ tech skills courses.