Esbuild: Support JSX annotation

Created on 24 May 2020  路  3Comments  路  Source: evanw/esbuild

Can we support JSX annotations?

Input

// @jsx h
<div />

Output

h('div') // Expected
React.createElement('div') // Actual

I am using esbuild in a build tool, that's why I need it.

Most helpful comment

The way to do this is to pass the --jsx-factory=h flag to esbuild or, if you're using the API, enable the jsxFactory: 'h' option. See also the Using with React section in the readme.

All 3 comments

The way to do this is to pass the --jsx-factory=h flag to esbuild or, if you're using the API, enable the jsxFactory: 'h' option. See also the Using with React section in the readme.

This is now supported as of version 0.6.3.

That's great, Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

elektronik2k5 picture elektronik2k5  路  3Comments

aelbore picture aelbore  路  4Comments

evanplaice picture evanplaice  路  3Comments

fannheyward picture fannheyward  路  4Comments

ojanvafai picture ojanvafai  路  3Comments