BuilderIO/mitosis

BUG: Mitosis does not camelCase HTML attributes in React

Open

#526 geöffnet am 28. Juni 2022

Auf GitHub ansehen
 (7 Kommentare) (0 Reaktionen) (1 zugewiesene Person)TypeScript (9.803 Stars) (411 Forks)batch import
coregood first issuereact

Beschreibung

Scope

  • This impacts ALL Mitosis outputs
  • This only impacts specific generators/outputs (please list them here): React

Describe the bug Attributes like srcset are camelCased in React (possibly other frameworks? Not sure). However, Mitosis does not account for that

To Reproduce

A link to a https://mitosis.builder.io/ fiddle containing the bug: link

Expected behavior scrset should become srcSet in the React output. Same goes for all HTML attributes that are multi-word: https://reactjs.org/docs/dom-elements.html

Additional context

  • I am not sure what the comprehensive list of camelCased DOM elements is, but we can probably look at React's JSX types to determine what to do
  • I am also not sure if other frameworks do this camelCasing. We might need to do this elsewhere too

Contributor Guide