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

Use forwardRef on Link, NavLink #6914

Merged
merged 1 commit into from
Sep 13, 2019
Merged

Use forwardRef on Link, NavLink #6914

merged 1 commit into from
Sep 13, 2019

Conversation

ryanflorence
Copy link
Member

@ryanflorence ryanflorence commented Sep 13, 2019

This allows components like @reach/menu-button to manage focus or do anything else they need to with the underlying DOM element.

This prefers the forwarded ref, but innerRef will still work too.

Related: reach/reach-ui#54

@gushiguera-rezi
Copy link

u da man!

@ryanflorence
Copy link
Member Author

@mjackson can I get a review here? thanks!

@pshrmn
Copy link
Contributor

pshrmn commented Sep 13, 2019

I don't think this can be merged into master while RR's react peer dependency is still >=15.

@ryanflorence
Copy link
Member Author

ryanflorence commented Sep 13, 2019

Ah, alright, I've done tricks before, I'll do them again, thanks Paul.

This allows components like @reach/menu-button to manage focus or do anything else they need to with the underlying DOM element.

While `ref` is preferred, the `innerRef` prop will still work.
@mjackson mjackson merged commit b5528ed into master Sep 13, 2019
@mjackson
Copy link
Member

LGTM, thanks @ryanflorence! Maybe we can use a similar technique to fix #6056.

@mjackson mjackson deleted the forwardRef branch September 13, 2019 18:50
@lock lock bot locked as resolved and limited conversation to collaborators Nov 12, 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.

None yet

4 participants