You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can define an onClick property in ButtonProps but it will remove the typing that the polymorphic component brings.
From these:
// when we set `as` to `a`
onClick?: React.MouseEventHandler<HTMLAnchorElement>|undefined// without setting the `as` property
onClick?: React.MouseEventHandler<HTMLButtonElement>|undefined
The other option is to augment the type like you have. Also, as per mantine's docs regarding wrapping polymorphic components it suggests to do it like so:
Current work around is to explicitly add the
onClick
prop to the wrapper.The text was updated successfully, but these errors were encountered: