mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
`JSXEmptyExpression` is never added to a React element's children [in `react.buildChildren`](https://github.com/babel/babel/blob/main/packages/babel-types/src/builders/react/buildChildren.ts), which is [used by](https://github.com/babel/babel/blob/main/packages/babel-plugin-transform-react-jsx/src/create-plugin.ts#L649) `plugin-transform-react-jsx`]. An alternative would be to represent JSX expressions differently in HIR, then codegen `JSXEmptyExpression`s back when we encounter an `EmptyExpression` ```js - children: Array<Place>, - children: Array<Place | "EmptyExpression">, ``` (We could also retain `JSXEmptyExpression` as an `InstructionValue` that produces a Primitive. However, this would make babel types in Codegen a bit more messy, as `JSXEmptyExpression` does not extend `Expression` (which currently is the result of every `InstructionValue`).)