React-aria-components & createLink
heya,
I'm working with RAC and tanstack router, and have moved away from RAC's RouterProvider pattern to createLink, but a few things have come up.
ListBoxItem can potentially be a link, but not always, if passed a href prop it renders an 'a' tag, otherwise its a div.
However, if I wrap my styled version of ListBoxItem in createLink it's always a 'a', and the to prop is always required.
And with Link,
I originally only exported the 'Link' component from my styled implementation, but in one place I needed to link externally via a href but typescript marks to a required prop which doesn't support external links.
I know the answer is 'you created a link, obviously it's gonna be a link' and just have 2 components, one for internal links, one for external links / standard behaviours is fair, but maybe someone has a better idea?
Thanks!
2 Replies
rare-sapphire•2mo ago
we wanted to allow href instead of to on link
just have not done yet
conscious-sapphireOP•2mo ago
That'd be great, having 1 Link, and then ListBoxItem & ListBoxItemLink is also cool since I won't have to think of new ways of naming things, and seems more intentional.
Thanks for all your hard work!