π Search Terms
JSX, spread, React.createElement
π Version & Regression Information
Issue is first seen in 5.1.6, and forward to 5.2.2 and the current nightly version.
β― Playground Link
https://www.typescriptlang.org/play?target=5&ts=5.2.2#code/DwYQ9gtgDgBATgSwOYAsAuBeA3sAJggNwD4APYAen2IF8YsA6RrGAdzjADskAuGPQ0hSpFq1ckQCwAKCA
π» Code
<Comp right={<div>x</div>} {...{ wrong: <div>x</div>}}/>
π Actual behavior
React.createElement(Comp, { right: React.createElement("div", null, "x"), wrong: <div>x</div> });
π Expected behavior
React.createElement(Comp, { right: React.createElement("div", null, "x"), wrong: React.createElement("div", null, "x") });
Additional information about the issue
The same bug seems to have been fixed in #54425, but only when the target is ES2017 or below. When target is set to ES2018 or above the issue still exists.