Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

In React Router v6, activeStyle will be removed and you should use the function style to apply inline styles to either active or inactive NavLink components.

<NavLink
  to="users"
  style={({ isActive }) => ({
    color: isActive ? '#fff' : '#545e6f',
    background: isActive ? '#7600dc' : '#f0f0f0',
  })}
>
  Users
</NavLink>
Source by ultimatecourses.com #
 
PREVIOUS NEXT
Tagged: #In #React #Router #activeStyle #removed #function #style #apply #inline #styles #active #inactive #NavLink
ADD COMMENT
Topic
Name
7+1 =