Put in order · JavaScript and React course · Module 6: React Router

Redirect configuration in React Router

Arrange the steps for configuring a redirect in React Router v6:

Items to put in order

  • The user is automatically redirected to the new path
  • Use the <Navigate to="/new-path" /> component
  • Define the source route (e.g., /old-path)
  • Add the replace={true} attribute to avoid saving to history

You can check the correct answer by solving this task in the CodeWorlds game.