score:1

i don't know how to do it using react router, but you can use window.history.pushstate() to solve your problem. in your third component add the following code into the render() method.

window.history.pushstate(null, null, '/your-welcome-page-url');

it will change the current url to welcome page url without reloading the page; and when you will press the browser back button, the browser will be redirected to welcome page.

score:1

i think you can make use of react-router-dom here. there is link element available in react-router-dom which can solve your problem.

for eg:, you can try something like this <link to="/welcomepage" >back</link>

for more information, go through below document react-router-dom document


Related Query

More Query from same tag