Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
React Router NavLink with inactiveClassName and isActive child function enhancements

This comment has been minimized.

Copy link
Owner Author

JofArnold commented Feb 1, 2018

Example use:

<NavLink {...someProps} inactiveClassName="blue" activeClassName="red">
  {({ isActive }) =>
    isActive ? <span>Active :)</span> : <span>Inactive :(</span>}

Probably needs the same for style attribute too, for completeness, but I'll leave that as a lesson for the reader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.