-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
Support de-camelCasing JSX html attributes #55
base: main
Are you sure you want to change the base?
Conversation
Taken the list of Preact supported attributes[1] and transform these attributes when building the rendered string. [1] https://github.com/developit/preact/blob/f717ee8e53248d75ff8c1a46966adeec295d339b/src/preact.d.ts#L547
We just ran into this bug today regarding srcSet attribute, would love to see this guy merged in :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to double check some of the attrs formatting. Noted a few, but there are some others.
spellCheck: 'spell-check', | ||
srcDoc: 'src-doc', | ||
srcLang: 'src-lang', | ||
srcSet: 'src-set', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'srcset'
srcDoc: 'src-doc', | ||
srcLang: 'src-lang', | ||
srcSet: 'src-set', | ||
tabIndex: 'tab-index', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'tabindex'
Hiya! Sorry for the delay in responding to PRs. I'm wondering about the size impact of this, versus using a regular expression transform like |
@developit the RegEx approach would suffer from the issue of transforming Combining both with a list of html attributes that need the hyphen to be removed might be a way to go. Any other ideas? |
Taken the list of Preact supported attributes and transform these attributes when building the rendered string.