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

Navigate component for redirects

Arrange the steps for implementing a Protected Route with the Navigate component:

Items to put in order

  • If yes - render children (the protected component)
  • Check if the user is logged in (isAuthenticated)
  • Create a ProtectedRoute component
  • If not - render <Navigate to='/login' />

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