When rendering a component using Material-UI Portal that includes several Material UI buttons, the following code is used:
<Portal container={this.myContainer}>
<Button onClick={this.handleClick}>Do something</Button>
//other buttons go here
</Portal>
Unfortunately, this setup leads to a TypeScript error:
TypeScript error: Type '{ children: Element[]; container: any; }' is not compatible with type 'Readonly<PortalProps>'.
The types of property 'children' are incompatible.
Type 'Element[]' cannot be assigned to type 'ReactElement<any, string | ((props: any) => ReactElement<any, string | ... | (new (props: any) => Component<any, any, any>)> | null) | (new (props: any) => Component<any, any, any>)>'.
This issue occurs in Material UI core version 3.9.0 and there doesn't seem to be a solution available in any existing type library.