BuilderIO/mitosis

BUG: Mitosis does not camelCase HTML attributes in React

Open

#526 aperta il 28 giu 2022

Vedi su GitHub
 (7 commenti) (0 reazioni) (1 assegnatario)TypeScript (411 fork)batch import
coregood first issuereact

Metriche repository

Star
 (9803 star)
Metriche merge PR
 (Merge medio 1g 1h) (6 PR mergiate in 30 g)

Descrizione

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

Guida contributor