Get to grips with React Hooks and design your own custom Hook to manage application states for making better decisions in site architecture Key Features * Discover solutions to common problems faced while designing Hooks with React Fiber * Explore tips, tricks, and best practices for identifying and solving site performance issue with Hooks * Understand Hook's design and turn your existing code into a reusable solution via custom Hooks Book Description 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. What you will learn * Discover how React Hooks are designed by exploring their implementation * Apply states and effects to address common modern user interface (UI) problems * Create your own Hooks to suit your own state management requirement * Detect the current window size of your website using useEffect * Debounce the action to improve UI performance using useMemo * Establish a global site configuration using useContext * Design a simple and effective API data layer using custom Hooks Who This Book Is For This book is for web developers and web architects who are looking for a consistent and efficient approach for applying Hooks. Basic knowledge of React will help you to get the most out of this book. Table of Contents * Introducing the Function Component * Crafting States in Functions * Hooking into React * Use State to Jumpstart Components * Use Effect to Handle Side Effects * Use Memo to Boost User Experience * Use Context to Cover an Area * Use Ref to Hide Stuff * Use Custom Hook to Reuse Logic * Building a Website with React
Book InformationISBN 9781803235950
Author Fang JinFormat Paperback
Page Count 250
Imprint Packt Publishing LimitedPublisher Packt Publishing Limited
Weight(grams) 75g