2 ms·
It 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
by whstl 1y ago
It 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