inProgress-team / inProgress-team/react-native-meteor
React Navigation - Refreshing page when DDP disconnected
- Dominant language
- JavaScript
- Stars
- 688
- Forks
- 200
- PR merge metrics
- No merged PRs in 30d
Description
Hi all,
I'm setting up react-native-meteor with react-navigation and applying the container as follows:
```
return {
connected: Meteor.status().connected,
user: Meteor.user(),
};
```
Then setting the login status to the state with:
```
componentDidMount() {
if (this.props.connected && this.props.user) {
this.setState({ loggedIn: true });
} else if (this.props.connected && !this.props.user) {
this.setState({ loggedIn: false });
}
}
```
and then rendering here:
```
render() {
return this.state.loggedIn ? : ;
}
```
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!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.