React-aria-components & createLink
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!