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

NavLink with active state

Arrange the NavLink with a dynamic class:

Items to click

  • > Asteroid Belt
  • isActive ? 'nav-active' : 'nav-link' }
  • <NavLink to="/asteroid"
  • className={({ isActive }) =>
  • </NavLink>

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