Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • If you want to redirect outside react components or without hooks, check out this answer. Commented Feb 10, 2022 at 6:56
  • 1
    What if / is a parent route to those others? How do you prevent / itself from being a route that can be navigated to? And instead redirect / to say /home when home is a child under /? Commented Apr 24, 2022 at 8:52
  • Worth noting that this has no SSR support for static routing 👍🏻 Commented May 11, 2022 at 10:46
  • 1
    @KashifAli in that case, you should replace the Navigation componet with you custom Not Found screen. I don't think you will be able to have both using a wildcard path. But you can use a Nested approach to limit when the user should be redirected inside some path. Commented Jun 16, 2022 at 18:00
  • 1
    Is there any api docs on Navigate and replace? It seems that i should have stopped with the docs, but somehow ended here. Commented Sep 19, 2022 at 11:37