preact-render-to-string icon indicating copy to clipboard operation
preact-render-to-string copied to clipboard

Support de-camelCasing JSX html attributes

Open blakef opened this issue 6 years ago • 3 comments

Taken the list of Preact supported attributes and transform these attributes when building the rendered string.

blakef avatar Feb 05 '18 12:02 blakef

We just ran into this bug today regarding srcSet attribute, would love to see this guy merged in :)

tconroy avatar Feb 22 '18 21:02 tconroy

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 avatar Aug 02 '18 02:08 developit

@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?

sventschui avatar Jun 02 '20 18:06 sventschui