import * as React from "react" ; /**
 * Returns true if `node` is null/undefined, false, empty string, or an array
 * composed of those. If `node` is an array, only one level of the array is
 * checked, for performance reasons.
 */ export function isReactNodeEmpty ( node ? , skipArray = false ) { return ( node == null || node === "" || node === false || ( ! skipArray && Array . isArray ( node ) && ( node . length === 0 || node . every ( n => isReactNodeEmpty ( n , true ) ) ) ) ) ; } internal export function isReactChildrenElementOrElements ( children ) { return ! isReactNodeEmpty ( children , true ) && children !== true ; } /**
 * Converts a React node to an element: non-empty string or number or
 * `React.Fragment` (React 16.3+) is wrapped in given tag name; empty strings
 * and booleans are discarded.
 */ export function ensureElement ( child , tagName = "span" ) { if ( child == null || typeof child === "boolean" ) { return undefined ; } else if ( typeof child === "string" ) { return child . trim ( ) . length > 0 ? React . createElement ( tagName , { } , child ) : undefined ; } else if ( typeof child === "number" || typeof ( child as any ) . type === "symbol" || Array . isArray ( child ) ) { return React . createElement ( tagName , { } , child ) ; } else if ( isReactElement ( child ) ) { return child ; } else { return undefined ; } } function isReactElement < T = any > ( child ) { return ( typeof child === "object" && typeof ( child as any ) . type !== "undefined" && typeof ( child as any ) . props !== "undefined" ) ; } /**
 * Represents anything that has a `name` property such as Functions.
 */ interface INamed { name ? : string ; } deprecated export function getDisplayName ( ComponentClass ) { return ( ComponentClass as React . ComponentType ) . displayName || ( ComponentClass as INamed ) . name || "Unknown" ; } param element param ComponentType export function isElementOfType < P = { } > ( element , ComponentType ) { return ( element != null && element . type != null && element . type . displayName != null && element . type . displayName === ComponentType . displayName ) ; } deprecated export function createReactRef < T > ( ) { return typeof React . createRef !== "undefined" ? React . createRef < T > ( ) : { current : null } ; } deprecated export type LifecycleCompatPolyfill < P , T extends React . ComponentClass < P > > = ( Comp : T ) => T & { [ K in keyof T ] : T [ K ] ; } ;