Currently, I’m thinking about replacing
this.context.router.push('/some/path') with some other lines. The idea is this. Before the page is loaded, it checks if current user is already logged in or not. If it is then please proceed to render the page normally and if not then please go to homepage.
The command for redirecting is either
this.context.router.transitionTo. This depends on library version. Unfortunately, I found yesterday that
push couldn’t be used anymore and neither could
transition be. So, what should I do?
Apparently, you could put
window.location = '/some/path' inside
componentWillMount. But I wonder if that’s a good idea.