12. State Management with Hooks

Overview

This chapter will focus on a detailed approach to using Hooks. You will be able to use the useState and useReducer functions to manage state and decide when to use what. You can create and manage complex state transitions using these hooks. To avoid the most common bugs, you will be able to use the useEffect hook and the various techniques of performing cleanups in order to optimize your code. You can create custom hooks based on state and effect. By the end of this chapter, you will have a solid understanding of implementing hooks.

Introduction

We have seen in the previous chapter how Hooks, as compared to render props, can simplify a React app. The methodical approach of Hooks helps in creating ...

Get The React Workshop now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.