A tool for people curious about the React Server Components protocol
rscexplorer.dev/
rsc
react
1// Internal React types adapted from React source (Flow -> TypeScript)
2
3import type { ReactNode, ReactElement as ReactElementPublic } from "react";
4
5export type ReactKey = string | null;
6
7/** Internal React element structure with $$typeof */
8export interface ReactElementInternal {
9 $$typeof: symbol;
10 type: unknown;
11 key: ReactKey;
12 ref: unknown;
13 props: Record<string, unknown>;
14}
15
16/** Lazy element type */
17export interface ReactLazy<T = unknown> {
18 $$typeof: symbol;
19 _payload: unknown;
20 _init: (payload: unknown) => T;
21}
22
23/** Check if value is a React element (internal) */
24export function isReactElement(value: unknown): value is ReactElementInternal;
25
26// Re-export React types we use
27export type { ReactNode, ReactElementPublic };