How to use HTML attributes for components #1365
Unanswered
FernandoArteaga
asked this question in
Q&A
Replies: 1 comment 2 replies
-
@FernandoArteaga what TypeScript error are you getting? Here's a guess: Your types are narrow/short. i.e. A button's type can be: type Button = {
type?: 'button' | 'submit' | 'reset' | null | undefined
} Try extending Or better yet, refer to how |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am trying for the first time Bits UI, and I started testing with the
Button
component.I would like to set some HTML attributes like
form
ortype
but the IDE shows me an error. However, it does not show any error when passingdata-*
to it.On the other hand, I tested the code in Stackblitz, using the same props and the HTML element rendered correctly without TS complaints. Which makes me wonder if it's a TS problem or am I using the wrong way to do this? Here the link
This is the snippet I am testing
Thanks for any help on this 😃
Beta Was this translation helpful? Give feedback.
All reactions