Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Simplifying State Management in React Native
  • Table Of Contents Toc
  • Feedback & Rating feedback
Simplifying State Management in React Native

Simplifying State Management in React Native

By : Aleksandra Desmurs-Linczewska
5 (3)
close
close
Simplifying State Management in React Native

Simplifying State Management in React Native

5 (3)
By: Aleksandra Desmurs-Linczewska

Overview of this book

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.
Table of Contents (17 chapters)
close
close
1
Part 1 – Learn the Basics: Intro to React, States, Props, Hooks, and Context
4
Part 2 – Creating a Real, Working App
7
Part 3 – Exploring Various Libraries for State Management in React Native
13
Part 4 – Summary
14
Chapter 10: Appendix

Configuring MobX in the Funbook app

As promised by the MobX authors, the boilerplate for this library is minimal. We will have to add three dependencies and a couple of files for everything to work correctly. Let’s start by adding the necessary dependencies by running the following command in the terminal:

npm install mobx mobx-state-tree –save

This command will install both MobX and MobX-State-Tree. MobX is unopinionated about the UI library we want to use it with. This means that when we decide to use a specific UI library, we will have to find a way to get it to cooperate with MobX. It so happens that we have chosen React Native as our UI library, so we need to add an additional dependency that will make MobX cooperate smoothly with React. Let’s run the following command:

npm install mobx-react-lite –save

Now that we have our dependencies, let’s run the following command:

expo start

It’s a good idea to check frequently...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY