diff --git a/crates/oxc_transformer/src/jsx/jsx_impl.rs b/crates/oxc_transformer/src/jsx/jsx_impl.rs index 05a28bb618c6f..d50e3a901bf83 100644 --- a/crates/oxc_transformer/src/jsx/jsx_impl.rs +++ b/crates/oxc_transformer/src/jsx/jsx_impl.rs @@ -719,10 +719,9 @@ impl<'a> JsxImpl<'a, '_> { // isStaticChildren if is_development { - arguments.push(Argument::from(ctx.ast.expression_boolean_literal( - SPAN, - if is_fragment { false } else { children_len > 1 }, - ))); + arguments.push(Argument::from( + ctx.ast.expression_boolean_literal(SPAN, children_len > 1), + )); } // Fragment doesn't have source and self diff --git a/tasks/transform_conformance/snapshots/oxc.snap.md b/tasks/transform_conformance/snapshots/oxc.snap.md index 42b3b7649f103..f7fc32dca02a4 100644 --- a/tasks/transform_conformance/snapshots/oxc.snap.md +++ b/tasks/transform_conformance/snapshots/oxc.snap.md @@ -1,6 +1,6 @@ commit: acbc09a8 -Passed: 132/154 +Passed: 133/155 # All Passed: * babel-plugin-transform-class-static-block @@ -261,7 +261,7 @@ rebuilt : SymbolId(2): [] x Output mismatch -# babel-plugin-transform-react-jsx (34/37) +# babel-plugin-transform-react-jsx (35/38) * refresh/does-not-transform-it-because-it-is-not-used-in-the-AST/input.jsx x Output mismatch diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/fragment-static-children/input.jsx b/tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/fragment-static-children/input.jsx new file mode 100644 index 0000000000000..da41540007f3e --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/fragment-static-children/input.jsx @@ -0,0 +1,4 @@ +<> +
+
+ diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/fragment-static-children/options.json b/tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/fragment-static-children/options.json new file mode 100644 index 0000000000000..bb40e72854126 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/fragment-static-children/options.json @@ -0,0 +1,4 @@ +{ + "plugins": [["transform-react-jsx-development"]], + "sourceType": "module" +} diff --git a/tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/fragment-static-children/output.js b/tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/fragment-static-children/output.js new file mode 100644 index 0000000000000..ca667d8e56fb3 --- /dev/null +++ b/tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/fragment-static-children/output.js @@ -0,0 +1,11 @@ +var _jsxFileName = "/tests/babel-plugin-transform-react-jsx/test/fixtures/fragment-static-children/input.jsx"; +import { jsxDEV as _jsxDEV, Fragment as _Fragment } from "react/jsx-dev-runtime"; +_jsxDEV(_Fragment, { children: [_jsxDEV("div", {}, void 0, false, { + fileName: _jsxFileName, + lineNumber: 2, + columnNumber: 3 +}, this), _jsxDEV("div", {}, void 0, false, { + fileName: _jsxFileName, + lineNumber: 3, + columnNumber: 3 +}, this)] }, void 0, true);