├── LICENSE └── README.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Packt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # State Management with React Query 2 | State Management with React Query, published by Packt 3 | 4 | State Management with React Query 5 | 6 | This is the code repository for [State Management with React Query](https://www.packtpub.com/product/state-management-with-react-query/9781803231341), published by Packt. 7 | 8 | **Improve developer and user experience by mastering server state in React** 9 | 10 | ## What is this book about? 11 | 12 | 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. 13 | 14 | This book covers the following exciting features: 15 | 16 | * Get to grips with state and how it's typically managed 17 | * Install and configure React Query and its Devtools 18 | * Manage server state data fetching with the useQuery hook 19 | * Create, update, and delete data using the useMutation hook 20 | * Employ React Query in combination with frameworks such as Next.js and Remix 21 | * Explore MSW and the testing library to test React Query using components 22 | 23 | If you feel this book is for you, get your [copy](https://www.amazon.com/State-Management-React-Query-experience/dp/1803231343) today! 24 | 25 | https://www.packtpub.com/ 27 | 28 | ## Instructions and Navigations 29 | All of the code is organized into folders. For example, chapter1. 30 | 31 | The code will look like the following: 32 | ``` 33 | const App = () => { 34 | ... 35 | return ( 36 |
37 |
Counter: {count}
38 |
39 | 40 | 41 | 42 |
43 |
44 | 45 | ``` 46 | 47 | **Following is what you need for this book:** 48 | 49 | 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. 50 | 51 | With the following software and hardware list you can run all code files present in the book (Chapter 1-9). 52 | ### Software and Hardware List 53 | | Software required | OS required | 54 | | ------------------------------------ | ----------------------------------- | 55 | | Yarn | Windows, macOS, or Linux | 56 | | pnpm | Windows, macOS, or Linux | 57 | | npm | Windows, macOS, or Linux | 58 | | JavaScript | Windows, macOS, or Linux | 59 | | React 16.8 | Windows, macOS, or Linux | 60 | | Remix | Windows, macOS, or Linux | 61 | | Next.js | Windows, macOS, or Linux | 62 | | Mock Service Worker | Windows, macOS, or Linux | 63 | | TanStack Query | Windows, macOS, or Linux | 64 | 65 | We also provide a PDF file that has color images of the screenshots/diagrams used in this book. [Click here to download it](https://packt.link/Wt1n6). 66 | 67 | 68 | ### Related products 69 | * AWS for Solutions Architects - Second Edition [[Packt]](https://www.packtpub.com/product/aws-for-solutions-architects-second-edition/9781803238951) [[Amazon]](https://www.amazon.com/AWS-Solutions-Architects-workload-cloud-native/dp/180323895X) 70 | 71 | * Cloud Computing Demystified for Aspiring Professionals [[Packt]](https://www.packtpub.com/product/cloud-computing-demystified-for-aspiring-professionals/9781803243313) [[Amazon]](https://www.amazon.com/Cloud-Computing-Demystified-Aspiring-Professionals/dp/1803243317) 72 | 73 | ## Get to Know the Author 74 | **Daniel Afonso** is a developer advocate with a full-stack background, having worked with different languages and frameworks on various projects, from IoT to fraud detection. He is passionate about learning and teaching and has spoken at multiple conferences related to React, JavaScript, and testing. In his free time, when he’s not learning new technologies or writing about them, he’s probably reading comics or watching superhero movies and shows. 75 | --------------------------------------------------------------------------------