![]() ![]() However, if I pass some random text in the URL like "localhost:3000/randomText" the CharacterDetails component still shows for a brief second till the useEffect fires to determine that the request is a 404 and only after that it redirects me to the App component. This works fine as long as I provide an existing Id so that CharacterDetails component fetches some data successfully. When I will click on submit, data will be submited and the application will take me to the 'Download PDF' page, also the form data will pass registration page to the 'Download PDF' page. Its very easy to achieve in react router, Lets create a new route for passing props to the component. One among them is passing props to the route component directly. In my react app I use react-router v6 and I have to following routes: } />Īs you can see, I have a route that needs an id. I'm trying to redirect to another page with passing data after submitting form in using react-router-dom v6. We have seen several examples and use cases in react router. I have a small issue I'm not able to fix.
0 Comments
Leave a Reply. |