skip to Main Content

How to change the path when NavLink is active – Reactjs

<NavLink className={({ isActive }) => (isActive ? "isActive" : "isNotActive")} to={"artist/" + currentMotive.artist.slug.current} key={currentMotive.artist.slug.current}> {currentMotive.artist.name} </NavLink> How can I change the attribute to in the same way as className? Like: to={({ isActive }) => isActive ? "/motive/" + currentMotive.slug.current :…

VIEW QUESTION
Back To Top
Search