wouter icon indicating copy to clipboard operation
wouter copied to clipboard

[feature] Wrap Link with forwardRef

Open avionbg opened this issue 1 year ago • 1 comments

There are cases where we need a working ref to rendered link dom node, it would really be helpful if this gets into the code.

avionbg avatar Jul 28 '22 11:07 avionbg

hi~, can you tell me what the scene is? maybe there are some workarounds.

cbbfcd avatar Jul 29 '22 09:07 cbbfcd

Most typical example would be MUI <Button component={Link} /> - which fails due to the missing ref.

avionbg avatar Sep 27 '22 09:09 avionbg

Same here, would be useful with MUI

trymoto avatar Oct 13 '22 12:10 trymoto

@cbbfcd I can go ahead and create a pr if it's ok, should be pretty straightforward.

trymoto avatar Oct 13 '22 13:10 trymoto

This has been implemented and released in https://github.com/molefrog/wouter/releases/tag/v2.8.0

Thanks @trymoto for your help!

molefrog avatar Nov 02 '22 10:11 molefrog