Book Image

Designing React Hooks the Right Way

By : Fang Jin
Book Image

Designing React Hooks the Right Way

By: Fang Jin

Overview of this book

React hook creates a unique solution for using states in function components to orchestrate UI communication. They provide you with an easy interface to write custom data management solutions with low development and maintenance costs. Understanding how Hooks are designed enables you to use them more effectively, and this book helps you to do just that. This book starts with a custom-crafted solution to reveal why Hooks are needed in the first place. You will learn about the React engine and discover how each built-in Hook can manage a persistent value by hooking into it. You will walk through the design and implementation of each hook with code so that you gain a solid understanding. Finally, you'll get to grips with each Hook's pitfalls and find out how to effectively overcome them. By the end of this React book, you'll have gained the confidence to build and write Hooks for developing functional and efficient web applications at scale.
Table of Contents (12 chapters)

Exploring functions of React

In this section, we will start with an exploration of the function React serves in the website development field. By doing that we hope to get a more accurate description about how React can help us.

The book has been dedicated to introducing a state into a function component under React, especially the hook mechanism. We hope that by reading this book, you get to know how to design hooks in the right way.

When comparing React to other UI frameworks, have you heard that sometimes people refer to it as a utility rather than a framework? There's no clear definition of what should be called a framework and what shouldn't. Judging by the amount of React source code and how it wires with other systems, we can hardly treat it as a utility library. But at the same time, we also should remember the goal that React established with in the first place, because knowing this will help you to use this technology in the right way. Let's take a look...