UNPKG

@winglet/react-utils

Version:

React utility library providing custom hooks, higher-order components (HOCs), and utility functions to enhance React application development with improved reusability and functionality

11 lines (10 loc) 566 B
import type { ComponentType } from 'react'; /** * Comprehensively checks if an object is any type of React component. * Tests for functional components, memoized components, and class components. * @typeParam Props - The component props type * @typeParam Component - The component type * @param component - The object to check * @returns Whether the object is a React component */ export declare const isReactComponent: <Props extends object = any, Component extends ComponentType<Props> = ComponentType<Props>>(component: unknown) => component is Component;