For input,
const foo = () => {
return <>
<p>foo</p>
<p>foo</p>
</>
}
oxc tranform outputs:
var _jsxFileName = "foo.jsx";
import { jsxDEV as _jsxDEV, Fragment as _Fragment } from "react/jsx-dev-runtime";
const foo = () => {
return _jsxDEV(_Fragment, { children: [_jsxDEV("p", { children: "foo" }, void 0, false, {
fileName: _jsxFileName,
lineNumber: 4,
columnNumber: 5
}, this), _jsxDEV("p", { children: "foo" }, void 0, false, {
fileName: _jsxFileName,
lineNumber: 5,
columnNumber: 5
}, this)] }, void 0, false);
};
The forth argument of _jsxDEV for _Fragment is false. This should be true.
reproduction using transform function from rolldown
If this is false, Warning: Each child in a list should have a unique "key" prop. error happens with React.
esbuild try with the same input
I found this while testing rolldown-vite on ecosystem-ci.
For input,
oxc tranform outputs:
The forth argument of
_jsxDEVfor_Fragmentisfalse. This should be true.reproduction using
transformfunction from rolldownIf this is
false,Warning: Each child in a list should have a unique "key" prop.error happens with React.esbuild try with the same input
I found this while testing rolldown-vite on ecosystem-ci.