admin管理员组文章数量:1122846
I have upgraded react and types packages to newest versions:
"react": "^19.0.0",
"react-dom": "^19.0.0",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",
In my component where I am using a children prop:
export const Tabel = ({
children,
}: {
children: React.FunctionComponent;
}) => {
// rest of the code here
return (<>
<OverlayLoader loading={mutation.isPending} />
{children({
onEdit,
onSave,
addRow,
onSelect,
})}
</>)
}
Since I updated react to v. 19 I get a typescript error for children prop:
Type Promise<ReactNode> is not assignable to type ReactNode
What type should I use for children prop then?
本文标签: reactjsUpgrading react to version 19throws a typescript error for children propStack Overflow
版权声明:本文标题:reactjs - Upgrading react to version 19, throws a typescript error for children prop - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736281926a1926477.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论