Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



I knew it transpiled to a function call, though I didn't know babel lets you parameterize that without writing a custom plugin




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: