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
I have reading the Docs on how to go back to previous State/page visited, but I don't find anything in the docs, please if you could point me the right direction that would be great
Thanks! and awesome work!
The text was updated successfully, but these errors were encountered:
The best thing would be to get the previous state from the last transition and use that as target:
Inside a routed component you can access the transition via props:
render(){let{transition}=this.props;// access the state we navigated fromletprevState=transition.from();letprevParams=transition.params('from');// navigate to the statetransition.router.stateService.go(prevState,prevParams);}
Since the router is synced with the browser history you can always navigate back using the DOM api:
window.history.back();
I guess it depends on what you need to achieve.
The first method is useful for handling redirects inside the application. In the sample app we redirect users that are not logged in to the log in page. Once the user has logged we find out which state triggered the original redirect and redirect the user back to that state (you can see here what I'm trying to explain).
Glad to help! Let me know if you have any more doubts!
It didn't work for me, nothing happens if I apply this. Using the DOM api is not an option for me, aren't there any other ways to go back? The documentation says nothing about it.
I have reading the Docs on how to go back to previous State/page visited, but I don't find anything in the docs, please if you could point me the right direction that would be great
Thanks! and awesome work!
The text was updated successfully, but these errors were encountered: