mobx-state-router icon indicating copy to clipboard operation
mobx-state-router copied to clipboard

RouterLink: use forwardRef

Open dodas opened this issue 5 years ago • 3 comments

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!

dodas avatar Nov 25 '20 21:11 dodas

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

nareshbhatia avatar Mar 14 '21 06:03 nareshbhatia

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.

dodas avatar Mar 14 '21 15:03 dodas

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

nareshbhatia avatar Apr 03 '21 18:04 nareshbhatia