The Best Can You Redirect To Home Page On Error With Reactjs References. In your handleclick method set a state and check in the render method and if that's true redirect like the following: So this when reloaded will take you.

It looks to be the most correct part you have. There's a slight problem with this answer, when the user reloads the page they're redirected to the above path. When i click on 'click me' button it should redirect to components.js.





