Skip to content

Redirecting actions based on if/else generates error #82

@jellyfangs

Description

@jellyfangs

I gitcloned and modified the Example app to check the state if the user is logged in or not.

If !this.state.loggedIn then redirect to the login route. However this generates a "Cannot read property 'getCurrentRoutes' of undefined" error

image

image

But if I remove the !this.state.loggedIn and simply check for this.state.loggedIn === true then the operation works and the Action is kicked off

Weird, can someone help?

Code here: https://github.com/jw84/routerDemo

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