Skip to content

React Navigation - Refreshing page when DDP disconnected #302

Open
@nloui

Description

@nloui

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 ? <StackNavigator /> : <SignedOut />;
  }

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions