inProgress-team / inProgress-team/react-native-meteor

React Navigation - Refreshing page when DDP disconnected

Open
#302 2 comments 5 reactions 0 assignees View on GitHub
Question
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.