Using the State Hook

Now that you've learned about the principles of React and had an introduction to Hooks, we are going to learn about the State Hook in depth. We will start by learning how the State Hook works internally by reimplementing it ourselves. Next, we learn about some of the limitations of Hooks, and why they exist. Then, we will learn about possible alternative Hook APIs and their associated problems. Finally, we learn how to solve the common problems that result from the limitations of Hooks. By the end of this chapter, we will know how to use the State Hook in order to implement stateful function components in React.

The following topics will be covered in this chapter:

  • Reimplementing the useState Hook as a simple function, which accesses the global state
  • Comparing our reimplementation to real React Hooks and learning about the differences
  • Learning about possible alternative Hook APIs and their trade-offs
  • Solving common problems resulting from the limitations of Hooks
  • Solving problems with conditional Hooks
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.93.136