3 ms·
You can build your own jsx renderer and get exactly that, it's not that difficult.
by vmg12 1y ago
You can build your own jsx renderer and get exactly that, it's not that difficult.
- brundolf 1y agoRight, 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