You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 26, 2018. It is now read-only.
I don't know if this is a common use case, but I have a case where I want the user to be able to back out of an action, and it might be useful to take them to some default location if the history stack is empty (say, they opened a link in a new tab).
For a little more detail, the user is on a page for joining a game, but if they decide they don't want to join, I want to give them the opportunity to get out easily. My idea is to give them a button to go back, but if their stack is empty, it'll do nothing. That's not the end of the world--they can always close the tab, of course--but it would probably be better to go to the homepage or something. I could use the history API to branch the logic, but it would be handy to be able to do something like
this.props.dispatch(goBack({ default: "/" })
so that it would go to the / route if there's nothing before it on the stack.