I have written typings to reactHelpers (#9565) but these functions (isMuiComponent and isMuiElement) are used for type checking.
So I think it is better to declare these functions as type guard.
By implementation,
export function isMuiElement(element: any, muiNames: Array<string>)
: element is ReactElement<P> & { type: { muiName: string } };
export function isMuiComponent<P>(element: any, muiNames: Array<string>): element is { muiName: string };
is considerable declaration (of course it looks not simple, so not good).
Is there any good type declaration for MUI element/component? or already exist? or the above functions should not be type guard (keep current, simply return boolean)?
I have written typings to reactHelpers (#9565) but these functions (
isMuiComponentandisMuiElement) are used for type checking.So I think it is better to declare these functions as type guard.
By implementation,
is considerable declaration (of course it looks not simple, so not good).
Is there any good type declaration for MUI element/component? or already exist? or the above functions should not be type guard (keep current, simply return boolean)?