custom link inside component with asChild
i can create a customLink provided by the examples in the doc.
But when i want to use this link inside a custom component, lets say a shadCN dropdown menu item with asChild, it throws an error that i should provide an forward ref.
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?
Basic example
How can i make the createLink function work so my Link component accepts a ref?
const const Link = React.forwardRef<HTMLAnchorElement, LinkComponent<typeof BasicLinkComponent>>((props, ref) => {
This doesn't work.0 Replies