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*

4
  • 5
    This looks like a bug in the docs. Notice how right in the section above that they deprecated render in favour of children? But it looks like that section you were reading talks about upgrading from v5 to v5.1, they only removed render in v6. Looks like <Route element={<Navigate to="/" />} /> is the new style. Commented Nov 7, 2021 at 1:40
  • gist.github.com/mjackson/… Commented Nov 7, 2021 at 1:44
  • Also from gist.github.com/mjackson/…: "When you finally do upgrade to v6, convert <Route render={() => ...}> to <Route element={...}> and you're done." Commented Nov 7, 2021 at 1:48
  • Thanks @Bergi I succeed by a little updates: <Route path="*" element={<Navigate to="/" />} />, feel free to post as an answer! Commented Nov 7, 2021 at 6:06