scrimba
Frontend Career Path
Advanced React
React Router
Active Link Styling with NavLink - part 2
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Active Link Styling with NavLink - part 2
AboutCommentsNotes
Active Link Styling with NavLink - part 2
Expand for more info
components
HostLayout.jsx
run
preview
console
import React from "react"
import { Link, Outlet } from "react-router-dom"

export default function HostLayout() {
/**
* Challenge - part 2:
* Make the host navbar indicate the currently-active route.
*
* Use the following CSS rules:
* font-weight: bold;
* text-decoration: underline;
* color: #161616;
*
* I'd recommend using an inline style this time.
*
* NOTE: There will be a small bug that we'll fix
* after you do the challenge.
*/

return (
<>
<nav className="host-nav">
<Link to="/host">Dashboard</Link>
<Link to="/host/income">Income</Link>
<Link to="/host/reviews">Reviews</Link>
</nav>
<Outlet />
</>
)
}
Console
/host
-5:12