{\n return (\n typeof child === \"object\" &&\n typeof (child as any).type !== \"undefined\" &&\n typeof (child as any).props !== \"undefined\"\n );\n}\n\n/**\n * Represents anything that has a `name` property such as Functions.\n */\ninterface INamed {\n name?: string;\n}\n\n/**\n * @deprecated will be removed in 4.0\n */\nexport function getDisplayName(ComponentClass: React.ComponentType | INamed) {\n return (ComponentClass as React.ComponentType).displayName || (ComponentClass as INamed).name || \"Unknown\";\n}\n\n/**\n * Returns true if the given JSX element matches the given component type.\n *\n * NOTE: This function only checks equality of `displayName` for performance and\n * to tolerate multiple minor versions of a component being included in one\n * application bundle.\n *\n * @param element JSX element in question\n * @param ComponentType desired component type of element\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function isElementOfType(\n element: any,\n ComponentType: React.ComponentType
,\n): element is React.ReactElement
{\n return (\n element != null &&\n element.type != null &&\n element.type.displayName != null &&\n element.type.displayName === ComponentType.displayName\n );\n}\n\n/**\n * Returns React.createRef if it's available, or a ref-like object if not.\n *\n * @deprecated use React.createRef or React.useRef\n */\nexport function createReactRef() {\n return typeof React.createRef !== \"undefined\" ? React.createRef() : { current: null };\n}\n\n/**\n * Replacement type for { polyfill } from \"react-lifecycles-compat\" useful in some places where\n * the correct type is not inferred automatically. This should be removed once Blueprint depends on React >= 16.\n * HACKHACK part of https://github.com/palantir/blueprint/issues/4342\n *\n * @deprecated use React 16\n */\nexport type LifecycleCompatPolyfill> = (Comp: T) => T & { [K in keyof T]: T[K] };\n","/*\n * Copyright 2018 Palantir Technologies, Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { isFunction } from \"./functionUtils\";\n\n/*\nUnderstanding the types here:\n\n`