I have a class that acts as a MobX store and fetches and stores all the data for a User Profile screen. From this profile screen, the user can then directly navigate to another user's profile screen. However, when this new profile screen is loaded, all data for the previous profile screen is lost which makes going back to that screen pointless.
How do I best tackle this issue? I was thinking of creating a new instance of the store class UserProfileStore in the constructor of the user profile screen component rather than injecting the store into the component but I'm not sure if that's the right/correct way to use MobX stores.
Currently, I'm passing the user profile store into the the provider as <Provider userProfileStore={new UserProfileStore()} /> and then injecting it into the user profile screen component.
No responses yet.