4 ms·
> 2. The JSX transform (part of the JSX spec. & what parser/compiler must represent the language as) Ah, ok I see where this misunderstanding stems from. See,
by aylmao 6y ago
> 2. The JSX transform (part of the JSX spec. & what parser/compiler must represent the language as)
Ah, ok I see where this misunderstanding stems from. See, this is not part of the spec. With JSX, there's a very popular transpiler (Babel's), but it's by no means the only one or even "the official one". The spec actually lists three, and mentions [1]:
> "These are a set of transpilers that all conform to the JSX syntax but use different semantics on the output: [...]"
JSX is most commonly used with React, so if you're making a JSX transpiler it makes sense to make your default output work with React. This is by no means part of the definition of JSX though or a spec requirement.
[1] https://facebook.github.io/jsx/ https://facebook.github.io/jsx/