Skip to content

Commit 818d1b0

Browse files
authored
fix(sandpack-react): use automatic runtime for jsx (#738)
1 parent d7a6faa commit 818d1b0

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

sandpack-react/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
presets: [
33
["@babel/preset-env", { targets: { node: "current" } }],
4-
"@babel/preset-react",
4+
["@babel/preset-react", { runtime: "automatic" }],
55
"@babel/preset-typescript",
66
],
77
};

sandpack-react/rollup.config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-var-requires */
12
const commonjs = require("@rollup/plugin-commonjs");
23
const typescript = require("@rollup/plugin-typescript");
34
const replace = require("rollup-plugin-replace");
@@ -28,6 +29,7 @@ const configBase = {
2829
commonjs({ requireReturnsDefault: "preferred" }),
2930
],
3031
external: [
32+
'react/jsx-runtime',
3133
...Object.keys(pkg.dependencies),
3234
...Object.keys(pkg.devDependencies),
3335
...Object.keys(pkg.peerDependencies),

sandpack-react/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"experimentalDecorators": true,
1010
"emitDecoratorMetadata": true,
1111
"noImplicitAny": true,
12-
"jsx": "react",
12+
"jsx": "react-jsx",
1313
"outDir": "dist/types",
1414
"skipLibCheck": true
1515
},

0 commit comments

Comments
 (0)