Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added component property to NavLink #5497

Closed
wants to merge 1 commit into from
Closed

Added component property to NavLink #5497

wants to merge 1 commit into from

Conversation

Nimelrian
Copy link

The new component property determines which React component a NavLink
will render. It defaults to Link, to retain current behavior when omitted.
The property can be used if the user wants to change the rendered
component, for example when they want to apply a higher order component
to Link, or to render something completely different.

Updated docs and added a new test case.

Fixes #5496

The new component property determines which react component a NavLink
will render. It defaults to Link, to retain current behavior when omitted.
The property can be used if the user wants to change the rendered
component, for example when they want to apply a higher order component
to Link, or to render something completely different.

Updated docs and added a new test case.
@mjackson
Copy link
Member

Thanks for the PR, @Nimelrian. I don't think we want to support rendering anything other than a <Link> inside <NavLink> though. <NavLink> is essentially just a decorator for a <Link> and should keep that same behavior.

@jakubrpawlowski
Copy link

So wrapping Link in HOC works, but wrapping NavLink doesn't. Not very intuitive.

Are there any known workarounds (that don't involve rewriting NavLink)?

@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants