How to redirect page with Javascript in React-Router?

Posted by Jessica Taylor | Updated on

Want to redirect page with Javascript in React-Router? Context is the best option, however official documentation tells that you can also use withRouter to put router prop to your component that would correctly perform history state transition:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers