rafgraph / react-router-hash-link

Hash link scroll functionality for React Router
https://react-router-hash-link.rafgraph.dev
MIT License
734 stars 62 forks source link

Forward refs properly #65

Closed joswhite closed 4 years ago

joswhite commented 4 years ago

NavHashLink and HashLink need to forward React refs properly. This will enable libraries like Material UI and React Router to be used properly with react-router-hash-link. For an example of where such behavior is needed, see this demo. The Material UI ListItem needs a ref to the root element provided by NavLink so it can focus it (as you can see from the source code).

rafgraph commented 4 years ago

Looks good, thanks!

rafgraph commented 4 years ago

Released as v2.0.0

joswhite commented 4 years ago

Thank you so much!