Closed
Description
Bug Report
π Search Terms
- jsx
- React
react-jsx
- transform
void 0
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about JSX
β― Playground Link
Playground link with relevant code
π» Code
export const el = <div>foo</div>;
tsconfig.json
:
"jsx": "react-jsx",
π Actual behavior
import { jsx as _jsx } from "react/jsx-runtime";
export const el = _jsx("div", { children: "foo" }, void 0);
π Expected behavior
import { jsx as _jsx } from "react/jsx-runtime";
export const el = _jsx("div", { children: "foo" });
This is how it works in Babel: Babel playground.
I just tried to migrate our codebase at Unsplash to use the new JSX transform but I noticed a cumulative increase of 5 KB across all chunks. If we can remove the extraneous void 0
, this should help reduce the bundle size.
Twitter thread for reference: https://twitter.com/OliverJAsh/status/1481912497175203840