From 4a699c09a686924f350b639d8d6c3a835c01ea8c Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Mon, 31 Aug 2020 11:26:18 +0200 Subject: [PATCH] stricter HTMLElementType --- packages/material-ui-utils/src/HTMLElementType.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/material-ui-utils/src/HTMLElementType.ts b/packages/material-ui-utils/src/HTMLElementType.ts index 618ac8f96e5902..f36ca5437fc13f 100644 --- a/packages/material-ui-utils/src/HTMLElementType.ts +++ b/packages/material-ui-utils/src/HTMLElementType.ts @@ -1,10 +1,10 @@ export default function HTMLElementType( - props: { [key: string]: any }, + props: { [key: string]: unknown }, propName: string, componentName: string, location: string, propFullName: string, -) { +): Error | null { if (process.env.NODE_ENV === 'production') { return null; } @@ -16,7 +16,7 @@ export default function HTMLElementType( return null; } - if (propValue && propValue.nodeType !== 1) { + if (propValue && (propValue as any).nodeType !== 1) { return new Error( `Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an HTMLElement.`,