Designing React Hooks the Right Way

By Fang Jin
    Advance your knowledge in tech with a Packt subscription

  • Instant online access to over 7,500+ books and videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies

About this book

React Hooks create unique solutions for solving problems faced while using functional components to orchestrate the communication of the modern UI. 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.

The book begins with a custom-built solution to reveal why Hooks are needed in the first place and takes you through the problems it is designed to solve. You'll learn about the React architecture with its two major internals, render and commit, and find out how a Hook can manage itself by hooking into them. The book then helps you to explore Hooks further by showing you how to design your own Hooks out of an existing code base and use states within context to communicate within a domain. For each Hook, you'll walk through its design and implementation by code so that you gain a solid understanding of how each one should be used. Finally, you'll get to grips with each Hook's pitfalls and discover how to effectively overcome them.

By the end of this React book, you'll have gained confidence in building and writing Hooks for developing functional and efficient web applications at scale.

Publication date:
February 2022

About the Author

  • Fang Jin

    Fang Jin is a software engineer that makes reusable and scalable web modules that can be applied to modern browsers and devices. He is an engineering hobbyist with interests ranging from economics and philosophy to software development, architecture, and team development. Fang is a lifelong learner and during his journey, he has helped organizations and teams adopting UI frameworks with consistent branding look and feel across departments to save cost and boost efficiency. In his free time, he likes swimming and surfing YouTube.

    Browse publications by this author
Designing React Hooks the Right Way
Unlock this book and the full library for FREE
Start free trial