4 ms·
Right, but only with a custom transpilation step. It would be nice if there were only a single standard JSX transpilation that all the frameworks and platforms
by brundolf 1y ago
Right, but only with a custom transpilation step. It would be nice if there were only a single standard JSX transpilation that all the frameworks and platforms ingested the output of
- whstl 1y agoIt kinda is! The only difference between JSX transpiler outputs is the factory function (and the Fragment component). For React the factory function it's `React.createElement`, for Preact it's `h`. Babel has a pragma property, and esbuild allows you to pass it in the command line: `--jsx-factory=h`. https://esbuild.github.io/content-types/#auto-import-for-jsx https://esbuild.github.io/content-types/#auto-import-for-jsx
- brundolf 1y agoI knew it transpiled to a function call, though I didn't know babel lets you parameterize that without writing a custom plugin