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
Source: stackoverflow.com
Related Query
- Redirect to welcome page on pressing back button in react Single page application
- react router: pressing back button does not bring user back to previous page
- react button onClick redirect page
- Hitting Back button in React app doesn't reload the page
- React, Single Page Apps, and the Browser's back button
- React JS page keeps refreshing when using the back button
- How to make a button redirect to another page in React
- React Router v4 - Redirect to home on page reload inside application
- Prevent browser back button for a specific page only in react
- Why is React Js called as Single Page Application
- Back button displays blank page in React
- How do you clean up an embedded youtube subscribe button on a single page application
- How to scroll to the particular div on button click in a single page application using react-router?
- React JS: How do I redirect back to my main page when user refreshes another particular page?
- How to I prevent user from accessing the page of my react app directly by entering the URL, and redirect them back to login page
- How to redirect another page after button on click method react js
- Redux, React for single page application login and logout
- In React is it possible to avoid reloading data from server upon pressing browser back button (without using Redux)?
- How do i redirect to a page from button click in react from a component?
- Force re-render the react component in the jquery single page application or in static html site?
- How can I make my Single Page Application (SPA) based on React render conditionally?
- Why does my react page go back without the button being clicked?
- Passed the button text to state, but text reverted back during page refresh in React hooks
- Getting map is not a function after pressing back button from a redirected page in react.js
- React update page with input info when pressing a button
- React Js : Redirect to another page on button click with table row data
- Forcing a page reload using React hooks when clicking back button on Safari
- How can i create a login page separately from my other single page application in react js
- React single page application
- React Router: How to re-render the page when the user presses the back button
More Query from same tag
- Why is react lazy adding time to first load
- React js render html string returned from server
- if webpage is being opened on a mobile device how to open phone call screen in react js web app
- Get array of objects from URLSearchParams
- ID from axios.delete request not making it to req.body to then delete from mySQL
- React Native Fetch on Android returns Network request failed
- How to get field from multiple-layer document in Firestore
- Constructor and render methods run twice in react component
- React: Inserting a child into an already-rendered parent
- How to work with JSON object in React
- Axios GET request to Spotify API returning 401
- Issue with using map on a array within a JSON response
- Best way to loop inside an object with the key being a value inside the object
- React js multiple routes files doesn't work
- React app componentDidMount not getting props from parent
- When to use 'classes' vs 'className' with Material UI?
- Getting a value of input field in a React component
- ESLint: TopBarClass not found in './TopBar'(import/named)
- React autofocus input after enabling a disabled input
- Object showing empty but has values? Undefined when mapping
- How to parse formdata on node serverside?
- ReactJS question about arrays in state and the async of it
- How to use componentdidmount in modal only when i use modal?
- My code gives "TypeError: Cannot read property 'map' of undefined" in ReactJs
- Api request still multiple times in set interval
- React router, how to restore state after browser back button?
- React Card Flip bug - Safari - Card not resizing as expected after flip
- State value from one React class used in another React class
- ReactJS 16.13.1 Hook incoherent state in listener
- React.js question: How do I apply multiple classes to a component using a ternary operator?