State Management with React Query: Improve developer and user experience by mastering server state in React
暫譯: 使用 React Query 的狀態管理:透過掌握 React 中的伺服器狀態來提升開發者和用戶體驗

Afonso, Daniel

  • 出版商: Packt Publishing
  • 出版日期: 2023-05-12
  • 售價: $1,360
  • 貴賓價: 9.5$1,292
  • 語言: 英文
  • 頁數: 228
  • 裝訂: Quality Paper - also called trade paper
  • ISBN: 1803231343
  • ISBN-13: 9781803231341
  • 相關分類: React使用者經驗 UX
  • 海外代購書籍(需單獨結帳)

商品描述

Beat common challenges in data fetching and data mutations while learning one of the most popular libraries for managing server state in React

Purchase of the print or Kindle book includes a free PDF eBook

Key Features

  • Learn how state is split into server and client state and the common challenges with each
  • Understand how React Query addresses server state challenges by facilitating data fetching and mutations
  • Apply the knowledge gained to improve developer experience and build applications with improved UX

Book Description

State management, a crucial aspect of the React ecosystem, has gained significant attention in recent times. While React offers various libraries and tools to handle state, each with different approaches and perspectives, one thing is clear: state management solutions for handling client state are not optimized for dealing with server state. React Query was created to address this issue of managing your server state, and this guide will equip you with the knowledge and skills needed to effectively use React Query for state management.

Starting with a brief history of state management in the React ecosystem, you'll find out what prompted the split from a global state to client and server state and thus understand the need for React Query. As you progress through the chapters, you'll see how React Query enables you to perform server state tasks such as fetching, caching, updating, and synchronizing your data with the server. But that's not all; once you've mastered React Query, you'll be able to apply this knowledge to handle server state with server-side rendering frameworks as well. You'll also work with patterns to test your code by leveraging the testing library and Mock Service Worker.

By the end of this book, you'll have gained a new perspective of state and be able to leverage React Query to overcome the obstacles associated with server state.

What you will learn

  • Get to grips with state and how it's typically managed
  • Install and configure React Query and its Devtools
  • Manage server state data fetching with the useQuery hook
  • Create, update, and delete data using the useMutation hook
  • Employ React Query in combination with frameworks such as Next.js and Remix
  • Explore MSW and the testing library to test React Query using components and hooks

Who this book is for

The book is for React developers who want to improve their state management skills and overcome the hurdles brought about by server state while improving their developer and user experience. Basic knowledge of web development and React will assist with understanding key concepts covered in this book. JavaScript developers will also find it useful.

商品描述(中文翻譯)

擊敗數據獲取和數據變更中的常見挑戰,同時學習 React 中最受歡迎的伺服器狀態管理庫之一。

購買印刷版或 Kindle 版書籍可獲得免費 PDF 電子書。

主要特點

- 學習狀態如何分為伺服器狀態和客戶端狀態,以及每種狀態的常見挑戰
- 了解 React Query 如何通過促進數據獲取和變更來解決伺服器狀態的挑戰
- 應用所學知識以改善開發者體驗並構建具有更佳用戶體驗的應用程序

書籍描述

狀態管理是 React 生態系統中的一個關鍵方面,最近受到廣泛關注。雖然 React 提供了多種庫和工具來處理狀態,每種都有不同的方法和觀點,但有一點是明確的:處理客戶端狀態的狀態管理解決方案並未針對伺服器狀態進行優化。React Query 的創建旨在解決管理伺服器狀態的問題,本指南將為您提供有效使用 React Query 進行狀態管理所需的知識和技能。

從 React 生態系統中狀態管理的簡要歷史開始,您將了解為何從全局狀態分裂為客戶端和伺服器狀態,從而理解 React Query 的必要性。隨著您逐步深入各章,您將看到 React Query 如何使您能夠執行伺服器狀態任務,例如獲取、緩存、更新和與伺服器同步數據。但這還不是全部;一旦您掌握了 React Query,您將能夠將這些知識應用於使用伺服器端渲染框架處理伺服器狀態。您還將利用測試庫和 Mock Service Worker 測試您的代碼模式。

在本書結束時,您將獲得對狀態的新視角,並能夠利用 React Query 克服與伺服器狀態相關的障礙。

您將學到的內容

- 理解狀態及其通常的管理方式
- 安裝和配置 React Query 及其開發者工具
- 使用 useQuery 鉤子管理伺服器狀態數據獲取
- 使用 useMutation 鉤子創建、更新和刪除數據
- 將 React Query 與 Next.js 和 Remix 等框架結合使用
- 探索 MSW 和測試庫,使用組件和鉤子測試 React Query

本書適合誰

本書適合希望提高狀態管理技能的 React 開發者,並克服伺服器狀態帶來的障礙,同時改善開發者和用戶體驗。具備基本的網頁開發和 React 知識將有助於理解本書中涵蓋的關鍵概念。JavaScript 開發者也會覺得這本書有用。

作者簡介

1. What Is State and How Do We Manage It?
2. Server State versus Client State
3. React Query - Introducing, Installing, and Configuring it
4. Fetching Data with React Query
5. More Data-Fetching Challenges
6. Performing Data Mutations with React Query
7. Server-Side Rendering with Next.js or Remix
8. Testing React Query Hooks and Components
9. What Changes in React Query v5

作者簡介(中文翻譯)

1. 什麼是狀態,如何管理狀態?
2. 伺服器狀態與客戶端狀態
3. React Query - 介紹、安裝與配置
4. 使用 React Query 獲取資料
5. 更多資料獲取挑戰
6. 使用 React Query 執行資料變更
7. 使用 Next.js 或 Remix 進行伺服器端渲染
8. 測試 React Query 鉤子和元件
9. React Query v5 的變更

最後瀏覽商品 (20)