UNPKG

1.65 kBTypeScriptView Raw
1// NOTE: Users of the React 18 alpha should add a reference
2// to 'react-is/next' in their project. See next.d.ts's top comment
3// for reference and documentation on how exactly to do it.
4
5export as namespace ReactIs;
6
7import { ElementType, LazyExoticComponent, MemoExoticComponent, ReactElement } from "react";
8
9export function typeOf(value: any): symbol | undefined;
10export function isValidElementType(value: any): value is ElementType;
11/**
12 * @deprecated
13 */
14export function isAsyncMode(value: any): value is ReactElement;
15export function isContextConsumer(value: any): value is ReactElement;
16export function isContextProvider(value: any): value is ReactElement;
17export function isElement(value: any): value is ReactElement;
18export function isForwardRef(value: any): value is ReactElement;
19export function isFragment(value: any): value is ReactElement;
20export function isLazy(value: any): value is LazyExoticComponent<any>;
21export function isMemo(value: any): value is MemoExoticComponent<any>;
22export function isProfiler(value: any): value is ReactElement;
23export function isPortal(value: any): value is ReactElement;
24export function isStrictMode(value: any): value is ReactElement;
25export function isSuspense(value: any): value is ReactElement;
26
27/**
28 * @deprecated
29 */
30export const AsyncMode: symbol;
31export const ContextConsumer: symbol;
32export const ContextProvider: symbol;
33export const Element: symbol;
34export const ForwardRef: symbol;
35export const Fragment: symbol;
36export const Lazy: symbol;
37export const Memo: symbol;
38export const Portal: symbol;
39export const Profiler: symbol;
40export const StrictMode: symbol;
41export const Suspense: symbol;