I required to add a redirection before rendering page and none of it was working. I just added an if condition for Auth-token and returned a "Navigate/>" just after render().