Loading
API REFERENCE
Wraps <Link> with additional props for styling active and pending states.
active and pending states
aria-current="page" to the link when the link is active. See aria-current on MDN.Here's an example of how to use the <NavLink> component:
tsximport { NavLink } from "rasengan";
tsx<NavLink to="/message">Messages</NavLink> // Using render props <NavLink to="/messages" className={({ isActive, isPending }) => isPending ? "pending" : isActive ? "active" : "" } > Messages </NavLink>
Learn more about the <NavLink> component here.