I am using ignite bowser boilerplate for my react native application. It uses mobx-state-tree for state management. Every time I restart my app it resets the store. Is there any way to persist store in ignite bowser ?
Asked
Active
Viewed 461 times
1
-
Ignite Bowser is setup to [initialize the store with the data that is already stored in `AsyncStorage`](https://github.com/infinitered/ignite-bowser/blob/a0f8ef6a8a2b3bbfbe3fad42e5ead4feede926ff/boilerplate/app/models/root-store/setup-root-store.ts#L35-L36) and [it puts the data in `AsyncStorage` on every MST state change](https://github.com/infinitered/ignite-bowser/blob/a0f8ef6a8a2b3bbfbe3fad42e5ead4feede926ff/boilerplate/app/models/root-store/setup-root-store.ts#L51-L52). Are you sure you are keeping your data in your store and not in local React component state or something similar? – Tholle Feb 21 '21 at 14:21
-
1fixed it, needed to import AsyncStorage from '@react-native-async-storage/async-storage' in utils file. – Prince Agrawal Feb 21 '21 at 16:15
1 Answers
1
Fixed it, needed to import AsyncStorage from '@react-native-async-storage/async-storage' in utils file.

Prince Agrawal
- 380
- 4
- 14