Simplifying State Management in React Native: Master state management from hooks and context through to Redux, MobX, XState, Jotai and React Query
- Length: 202 pages
- Edition: 1
- Language: English
- Publisher: Packt Publishing
- Publication Date: 2023-01-13
- ISBN-10: 1803235039
- ISBN-13: 9781803235035
- Sales Rank: #0 (See Top 100 Books)
Make fact-based decisions by comparing different solutions and learning popular ways to manage state in React Native with clear guidelines and recommendations by a React Native expert
Key Features
- Explore the big picture of state management in React Native using the most simplified version
- Implement state management solutions by building a social media clone app
- Compare different state solutions in a contained environment to choose the best fit for your future projects
Book Description
Managing state in a React Native app can be challenging as it is one of the most difficult concepts to grasp while learning React Native. This is because there are so many ways to do it, and because there is a lack of clear guidelines on what should be used and why.
Simplifying State Management in React Native is a comprehensive introduction for those who are new to creating robust React Native apps that will have you up to speed in no time. You’ll get to grips with the different state management strategies and libraries available. As you progress through the chapters, you’ll try out different solutions, as well as compare and choose which solution is perfectly suited to your future projects and personal preferences. Finally, you’ll create a social media clone app using all the concepts and examples that you’ve learned in this book.
By the end of this book, you’ll be able to take on existing projects that use various state management strategies and libraries, and confidently make decisions about state management.
What you will learn
- Start out by going over the basic ReactJS “mindset”
- Explore all that ReactJS has to offer to manage state in apps by building an app
- Understand existing state management libraries such as Redux, MobX, XState, Jotai, and React Query
- Decide which libraries you want to use in your apps
- Design a social media app to fully understand state management
- Try out all the solutions presented in the book in a social media clone app
Who this book is for
This book is for junior developers, React Native developers, and mobile app developers who are already using React Native, but are also on the lookout for advice and for a broader view to manage the state and changes in their applications. Basic knowledge of ReactJS and React Native, as well as familiarity with JavaScript and general mobile app development concepts are needed to grasp the topics covered in this book.
Cover Title Page Copyright and Credits Contributors Table of Contents Preface Part 1 – Learn the Basics: Intro to React, States, Props, Hooks, and Context Chapter 1: What are React and React Native? Understanding the history of ReactJS The predecessors And then there was React Thinking in React (the React mindset) Understanding cross-platform software development Going over the history of React Native Reviewing examples of popular apps using React Native Summary Chapter 2: Managing State in a Simple React App Technical requirements What is state and how is it different from props? What are stateful and stateless components? What are hooks and why use them? Which hooks should you know? Setting up the example app Environment setup App structure Summary Further reading Part 2 – Creating a Real, Working App Chapter 3: Planning and Setting Up the Funbook App Technical requirements Planning the needed surfaces and components Planning data flows in the app Getting comfortable previewing and debugging the app Summary Further reading Chapter 4: Styling and Populating the Funbook App Technical requirements Creating and styling components Pulling in data for the app Summary Further reading Part 3 – Exploring Various Libraries for State Management in React Native Chapter 5: Implementing Redux in Our Funbook App Technical requirements What is Redux? A brief history Installing and configuring Redux Dispatching actions Adding Redux functionalities to the app User login state walkthrough Using Redux for liked images Combining various pieces of global state Taking advantage of Redux Toolkit for creating actions Fetching data Replacing the context Debugging Summary Further reading Chapter 6: Using MobX as a State Manager in a React Native App Technical requirements Going over MobX concepts Configuring MobX in the Funbook app Using MobX for FavoritedImages Creating the store Fetching data Adding actions Deriving data from state Summary Further reading Chapter 7: Untangling Complex Flows in React Native Apps with XState Technical requirements What are finite state machines? What is XState – high-level concepts Configuring XState in the Funbook app Using XState for the FavoritedImages surface Configuring context and components Fetching image data Managing the image in the image modal Liking images Summary Further reading Chapter 8: Integrating Jotai in a React Native App Technical requirements What is Recoil and an atomic state? What is Jotai? Configuring Jotai in the Funbook app Using Jotai for ListOfFavoritedImages Fetching data with Jotai Reading and writing atoms Adding read-write functionality to the imageListAtom Implementing the Like button Summary Further reading Chapter 9: Using React Query for Server-Side-Driven State Management Technical requirements What is React Query and why is it in this book? Installing and configuring React Query Using React Query for data fetching Fetching image data Other React Query Functionalities React Query utilities for React Native Summary Further reading Part 4 – Summary Chapter 10: Appendix Index Other Books You May Enjoy
Donate to keep this site alive
How to download source code?
1. Go to: https://github.com/PacktPublishing
2. In the Find a repository… box, search the book title: Simplifying State Management in React Native: Master state management from hooks and context through to Redux, MobX, XState, Jotai and React Query
, sometime you may not get the results, please search the main title.
3. Click the book title in the search results.
3. Click Code to download.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.