You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the classic JSX transpilation mode (jsx: "react") the name of the prop for JSX children is up to the createElement function. Custom JSX runtime could use non-children names. The role of ElementChildrenAttribute is to tell TypeScript the name of the prop used by createElement for JSX children.
const$el=React.createElement("div",null,"test");
However, under the modern jsx: "react-jsx" setting, the name of the prop for JSX children is always children and is hardcoded to the transpilation result.
const$el=_jsx("div",{children: "test"});
This means that in the new mode you can't change the name of children. Therein ElementChildrenAttribute plays no role.
This is why I changed so that ElementChildrenAttribute is ignored under the jsx: "react-jsx" mode.
I believe you should stop using ElementChildrenAttribute and find another way to acomplish what you want (sorry, I'm not sure why you've been using ElementChildrenAttribute in your custom JSX runtime)
Activity
uhyo commentedon Mar 5, 2025
Hi there, I'm the one who broke this 😨 (#60880)
But I believe the new error is correct.
A bit of history:
In the classic JSX transpilation mode (
jsx: "react") the name of the prop for JSX children is up to thecreateElementfunction. Custom JSX runtime could use non-childrennames. The role ofElementChildrenAttributeis to tell TypeScript the name of the prop used bycreateElementfor JSX children.However, under the modern
jsx: "react-jsx"setting, the name of the prop for JSX children is alwayschildrenand is hardcoded to the transpilation result.This means that in the new mode you can't change the name of
children. ThereinElementChildrenAttributeplays no role.This is why I changed so that
ElementChildrenAttributeis ignored under thejsx: "react-jsx"mode.I believe you should stop using
ElementChildrenAttributeand find another way to acomplish what you want (sorry, I'm not sure why you've been usingElementChildrenAttributein your custom JSX runtime)morlay commentedon Mar 5, 2025
uhyo (@uhyo) Sure.
I will try to find another way to solve it.
However I think it is undocumented break change.
This feature here so many years 😂
https://www.typescriptlang.org/docs/handbook/jsx.html#children-type-checking
morlay commentedon Mar 6, 2025
resolved.
just force rename public prop
$defaultwhich as default slot in vue tochildren