nareshbhatia / mobx-state-router

MobX-powered router for React apps
https://nareshbhatia.github.io/mobx-state-router/
MIT License
227 stars 31 forks source link

RouterLink: use forwardRef #102

Open dodas opened 3 years ago

dodas commented 3 years ago

Hi! Thanks for great little router!

I just noticed that <RouterLink> does not accept ref prop. This should be easily solved by adding forwardRef, if I am not mistaken.

Should I send a PR? Thanks!

nareshbhatia commented 3 years ago

Hi @dodas, may I know what use case are you trying to solve using a ref into the link?

dodas commented 3 years ago

Hey Naresh!

Accessing the underlying element though the ref can be useful in many cases. For example, if you wrap RouterLink in Chakra UI's Tooltip, the tooltip won't be positioned correctly, because Chakra UI cannot access the underlying element.

nareshbhatia commented 3 years ago

Hi @dodas, please feel free to submit a PR on the mobx6-update branch.