BuilderIO/mitosis

BUG: Mitosis does not camelCase HTML attributes in React

Open

#526 ouverte le 28 juin 2022

Voir sur GitHub
 (7 commentaires) (0 réactions) (1 assigné)TypeScript (411 forks)batch import
coregood first issuereact

Métriques du dépôt

Stars
 (9 803 stars)
Métriques de merge PR
 (Merge moyen 1j 1h) (6 PRs mergées en 30 j)

Description

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

Guide contributeur