@@ -6,11 +6,11 @@ oneline: "Specify what JSX code is generated."
66Controls how JSX constructs are emitted in JavaScript files.
77This only affects output of JS files that started in ` .tsx ` files.
88
9- - ` react ` : Emit ` .js ` files with JSX changed to the equivalent ` React.createElement ` calls
10- - ` react-jsx ` : Emit ` .js ` files with the JSX changed to ` _jsx ` calls
11- - ` react-jsxdev ` : Emit ` .js ` files with the JSX changed to ` _jsx ` calls
9+ - ` react-jsx ` : Emit ` .js ` files with the JSX changed to ` _jsx ` calls optimized for production
10+ - ` react-jsxdev ` : Emit ` .js ` files with the JSX changed to ` _jsx ` calls for development only
1211- ` preserve ` : Emit ` .jsx ` files with the JSX unchanged
1312- ` react-native ` : Emit ` .js ` files with the JSX unchanged
13+ - ` react ` : Emit ` .js ` files with JSX changed to the equivalent ` React.createElement ` calls
1414
1515### For example
1616
@@ -20,7 +20,7 @@ This sample code:
2020export const HelloWorld = () => <h1 >Hello world</h1 >;
2121```
2222
23- Default : ` "react" `
23+ React : ` "react-jsx" ` < sup > [[ 1 ]] ( https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html ) </ sup >
2424
2525``` tsx twoslash
2626declare module JSX {
@@ -31,10 +31,11 @@ declare module JSX {
3131}
3232// @showEmit
3333// @noErrors
34+ // @jsx: react-jsx
3435export const HelloWorld = () => <h1 >Hello world</h1 >;
3536```
3637
37- Preserve : ` "preserve" `
38+ React dev transform : ` "react-jsxdev" ` < sup > [[ 1 ]] ( https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html ) </ sup >
3839
3940``` tsx twoslash
4041declare module JSX {
@@ -45,11 +46,11 @@ declare module JSX {
4546}
4647// @showEmit
4748// @noErrors
48- // @jsx: preserve
49+ // @jsx: react-jsxdev
4950export const HelloWorld = () => <h1 >Hello world</h1 >;
5051```
5152
52- React Native : ` "react-native " `
53+ Preserve : ` "preserve " `
5354
5455``` tsx twoslash
5556declare module JSX {
@@ -60,11 +61,11 @@ declare module JSX {
6061}
6162// @showEmit
6263// @noErrors
63- // @jsx: react-native
64+ // @jsx: preserve
6465export const HelloWorld = () => <h1 >Hello world</h1 >;
6566```
6667
67- React 17 transform : ` "react-jsx" ` < sup > [[ 1 ]] ( https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html ) </ sup >
68+ React Native : ` "react-native" `
6869
6970``` tsx twoslash
7071declare module JSX {
@@ -75,11 +76,12 @@ declare module JSX {
7576}
7677// @showEmit
7778// @noErrors
78- // @jsx: react-jsx
79+ // @jsx: react-native
7980export const HelloWorld = () => <h1 >Hello world</h1 >;
8081```
8182
82- React 17 dev transform: ` "react-jsxdev" ` <sup >[[ 1]] ( https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html ) </sup >
83+
84+ Legacy React runtime: ` "react" `
8385
8486``` tsx twoslash
8587declare module JSX {
@@ -90,6 +92,5 @@ declare module JSX {
9092}
9193// @showEmit
9294// @noErrors
93- // @jsx: react-jsxdev
9495export const HelloWorld = () => <h1 >Hello world</h1 >;
9596```
0 commit comments