cschroeter / park-ui

Beautifully designed components built with Ark UI and Panda CSS that work with a variety of JS frameworks.
https://park-ui.com
MIT License
1.74k stars 75 forks source link

Text components' ref does not cast to correct element type when using `as` property #450

Open bohdanbirdie opened 1 month ago

bohdanbirdie commented 1 month ago

When using Text component with as property to change the element from <p/> to <span/> the ref types are not casted

const ref = useRef<HTMLSpanElement>(null)
.....
....
<Text
  as='span'
  ref={ref}
>
  {children}
</Text>

CleanShot 2024-10-10 at 12 50 07@2x

Issue seems to be propagated from the styled call with the cast to a specific element

CleanShot 2024-10-10 at 12 51 31@2x