-
Notifications
You must be signed in to change notification settings - Fork 53
fix(types): reflect html standard in propNames type #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(types): reflect html standard in propNames type #113
Conversation
Er, no? It requires
This absolutely should not be done. HTML doesn't even use kebab case for most attributes, much less all. Trying to convert naming schemes was a bad idea, IMO, and will be removed in the next major. The types should only require that your |
That just how attributes work? They're always lower case.
|
sure but |
Add interface Props {
firstName: string;
first-name: string;
}
function MyComponent(props) {
// ...
}
register(MyComponent, 'my-component', ['first-name']);
// <my-component first-name="Ryan"></my-component> |
Yes, that's entirely intentional... you should explicitly declare which props your component takes. Don't write super long prop names if you don't want to type a lot I guess? I'm not really sure what to tell you, surely that's a universal issue, nothing specific to this? As I mentioned, that |
With #108 the register method now requires the propNames array to contain the prop names in camelcase which is incorrect:

With my changes only the required kebab case props taken from the component are allowed to be passed:
