preact-render-to-string
preact-render-to-string copied to clipboard
Support de-camelCasing JSX html attributes
Taken the list of Preact supported attributes and transform these attributes when building the rendered string.
We just ran into this bug today regarding srcSet attribute, would love to see this guy merged in :)
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 name.replace(/([A-Z])/,'-$1').toLowerCase()
.
@developit the RegEx approach would suffer from the issue of transforming tabIndex
to tab-index
instead of tabindex
.
Combining both with a list of html attributes that need the hyphen to be removed might be a way to go.
Any other ideas?