Learn React Hooks
eBook - ePub

Learn React Hooks

Unlock scalable state, performance, and clean code with Hooks, Context, Suspense, and Form Actions

  1. English
  2. ePUB (mobile friendly)
  3. Available on iOS & Android
eBook - ePub

Learn React Hooks

Unlock scalable state, performance, and clean code with Hooks, Context, Suspense, and Form Actions

About this book

Grasp the core concepts of React Hooks and enhance your development workflow with best practices and advanced patterns derived from modern React 19 features

Key Features

  • Build custom Hooks to simplify complex logic and promote code reusability
  • Transform class components into modern, hook-based function components, and write robust tests
  • Build maintainable, production-ready UIs using React 19's declarative approach and ecosystem tools
  • Purchase of the print or Kindle book includes a free PDF eBook

Book Description

React Hooks allow you to easily encapsulate, reuse, and refactor logic with the same level of simplicity that components bring to user interface organization. In this second edition, React expert and author of many popular React books, Daniel Bugl guides you through the full spectrum of React Hooks, and teaches you how to handle forms, routing, and data fetching in modern React development. This edition is fully updated to React 19, with a revamped structure, expanded real-world use cases, and coverage of all newly introduced Hooks. Starting with the fundamentals, you'll gain a deep understanding of how Hooks work under the hood and how to apply Hooks patterns efficiently. The chapters guide you through using State, Reducer, and Effect Hooks to manage application state, side effects, and complex logic for building your first Hook-based app. You'll utilize Suspense and Context APIs for streamlined data fetching and state management, master Form Actions for handling submissions, and implement routing with Hooks. You'll also create custom Hooks for advanced functionality and write tests for reliability. Finally, you'll learn how to refactor an existing app with class components into modern Hooks architecture. By the end of this React book, you'll be well-equipped to use React Hooks to modernize and optimize your React projects.

What you will learn

  • Master and apply new React 19 Hooks, such as useActionState, useFormStatus, useOptimistic, and others
  • Use React Hooks and Context to manage state in your web applications
  • Efficiently fetch, update, and cache data using TanStack Query and Suspense
  • Manage user input and form submission using Form Actions with Hooks
  • Discover how to implement routing in your apps using React Router and Hooks
  • Create and test your own Hooks to encapsulate, reuse, and refactor logic in your apps

Who this book is for

This book is ideal for React developers looking to modernize their applications using React Hooks, Context, and Suspense. Beginners and experienced developers alike will gain a solid understanding of Hooks and their internal workings. If you're familiar with React and JavaScript, this book will help you upskill by teaching you best practices, performance optimization, and scalable application building. No prior experience with Hooks is required—this book covers everything from fundamentals to advanced patterns.

]]>

Trusted by 375,005 students

Access to over 1.5 million titles for a fair monthly price.

Study more efficiently using our study tools.

Information

Year
2025
eBook ISBN
9781836209164

Table of contents

  1. Preface
  2. Introduction to Hooks
  3. Introducing React and React Hooks
  4. Using the State Hook
  5. Writing Your First Application with React Hooks
  6. Using Hooks With Real-World Examples
  7. Using the Reducer and Effect Hooks
  8. Implementing React Contexts
  9. Using Hooks and React Suspense for Data Fetching
  10. Using Hooks for Handling Forms
  11. Using Hooks for Routing
  12. Advanced Hooks Provided by React
  13. Using Community Hooks
  14. Refactoring and Migrating Existing Code
  15. Rules of Hooks
  16. Building Your Own Hooks
  17. Migrating from React Class Components
  18. Index

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.5M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1.5 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Learn React Hooks by Daniel Bugl in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in JavaScript. We have over 1.5 million books available in our catalogue for you to explore.