Skip to content

Cannot read property 'dispatch' of undefined on componentDidMount #251

@sibelius

Description

@sibelius

I am trying to create a Login screen that will go directly to another screen if the user is already authenticated.

componentDidMount() {
    const { isAuthenticated, isFetching } = this.props.user;

    if (isAuthenticated && !isFetching) {
      Actions.tabbar(); // go to tabbar if is authenticated and is not fetching
    }
  }

I am getting the user from AsyncStorage, is there any work around to do the same behavior?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions