BuilderIO/mitosis

BUG: Mitosis does not camelCase HTML attributes in React

Aperta

#526 aperta il 28 giu 2022

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

Metriche repository

Star
 (9803 stelle)
Metriche merge PR
 (Metriche PR in attesa)

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