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