Open nloui opened 6 years ago
@nloui Would you share how you solved this?
@nloui @townmulti I'm dealing with exactly the same issue at the moment. In fact, this happens for all collections and is due to react-native-meteor clearing all collections in minimongo when the app (re-)connects.
I was able to solve the issue for the user (and thus the navigation, in my case at least) by persisting the user object in a redux store and then calling that store if no Meteor.user()
exists. This requires some boilerplate redux and also to replace calls to Meteor.user()
with this new function instead (and subsequently also Meteor.login()
and Meteor.logout()
.
The same could be done with all collections but adds another layer and I believe is not ideal.
It might be enough to simply remove that loop that removes all data...
Hi all,
I'm setting up react-native-meteor with react-navigation and applying the container as follows:
Then setting the login status to the state with:
and then rendering here:
It seems to work, but I notice that the DDP connection gets disconnected very so often and completely resets the StackNavigator. Any suggestions on how to avoid this? Appreciate the help!