Reference

@reckona/mreact

90 public exports.

Function

Functionactfunction act<T>(callback: (): T): T extends PromiseLike<unknown> ? Promise<void> : voidFlushes React-compatible updates produced inside a test interaction.FunctionapplyStreamingHydrationFragmentsfunction applyStreamingHydrationFragments(root?: ParentNode): voidApplies streamed out-of-order hydration fragments to their placeholders.Functioncachefunction cache<TArgs, TResult>(callback: (...args: TArgs): TResult): (...args: TArgs): TResultMemoizes a function within the currently active cache scope.FunctioncacheSignalfunction cacheSignal(): AbortSignal | nullReturns the abort signal for the currently active cache scope.FunctioncaptureOwnerStackfunction captureOwnerStack(): string | nullReturns the current owner stack captured for cache diagnostics.FunctioncloneElementfunction cloneElement<P>(element: ReactCompatElement<P>, props: Partial<P> & ReactReservedProps | null, ...children: ReactCompatNode[]): ReactCompatElement<P>Clones an existing element with merged props and optional replacement children.FunctioncreateContextfunction createContext<T>(defaultValue: T): ReactCompatContext<T>Creates a context object with Provider and Consumer entries.FunctioncreateElementfunction createElement<P>(type: ElementType<P>, config: P & ReactReservedProps | null, ...children: ReactCompatNode[]): ReactCompatElement<P>Creates a React-compatible element from a type, config object, and children.FunctioncreateErrorBoundaryfunction createErrorBoundary(options: ErrorBoundaryOptions, children: ReactCompatNode): ReactCompatElement<ErrorBoundaryOptions & { children: ReactCompatNode }>Creates an error boundary element with a fallback renderer.FunctioncreatePortalfunction createPortal(children: ReactCompatNode, container: Element, key?: unknown): ReactCompatPortalCreates a portal that renders children into a DOM container outside the parent tree.FunctioncreateReffunction createRef<T>(): { current: T | null }Creates a mutable ref object with a null initial current value.FunctioncreateRootfunction createRoot(container: Element, options?: RootOptions): RootCreates a root that renders React-compatible nodes into a DOM container.FunctioncreateStreamingHydrationRootfunction createStreamingHydrationRoot(container: Element, options?: StreamingHydrationRootOptions): StreamingHydrationRootCreates a root that can hydrate streamed or selectively revealed markup.FunctionenableEventHydrationManifestReplayfunction enableEventHydrationManifestReplay(container: Element, manifest: EventHydrationManifest | undefined, options?: HydrationEventReplayOptions): (): voidCaptures only the event types declared by a hydration manifest.FunctionenableHydrationEventReplayfunction enableHydrationEventReplay(container: Element): (): voidCaptures supported events on a container until hydration can replay them.FunctionflushSyncfunction flushSync<T>(callback: (): T): TRuns updates synchronously and flushes pending reactive work before returning.FunctionforwardReffunction forwardRef<P, T>(render: (props: P, ref: { current: T | null } | (value: T | null): void | null): ReactCompatNode): ForwardRefType<P & { ref?: unknown }>Wraps a component so it can receive a ref as the second render argument.FunctionhydrateRootfunction hydrateRoot(container: Element, element: ReactCompatNode, options?: HydrateRootOptions): RootHydrates server-rendered markup with a React-compatible element tree.Functionlazyfunction lazy<P>(load: (): Promise<{ default: ElementType<P> }>): LazyType<P>Creates a lazy element type that resolves its implementation on demand.Functionmemofunction memo<P>(type: ElementType<P>, compare?: (previous: P, next: P): boolean): MemoType<P>Wraps an element type with optional prop comparison for memoized renders.FunctionqueueHydrationEventfunction queueHydrationEvent(container: Element, event: Event, target: EventTarget): voidQueues a captured event so it can be replayed after hydration.FunctionreadEventHydrationManifestfunction readEventHydrationManifest(root?: ParentNode): EventHydrationManifest | undefinedReads an event hydration manifest script from a document or parent node.Functionrenderfunction render(element: ReactCompatNode, container: Element): voidRenders a React-compatible node into a legacy root container.FunctionrenderChildToStringfunction renderChildToString(value: unknown): stringFunctionrenderContextConsumerToStringfunction renderContextConsumerToString<T>(consumer: ReactCompatConsumer<T>, render: (value: T): string): stringRenders a string with the current value from a context consumer.FunctionrenderContextProviderToStringfunction renderContextProviderToString<T>(provider: ReactCompatProvider<T>, value: T, render: (): string): stringRenders a string while a provider value is active.FunctionrenderToStringfunction renderToString<TProps>(component: (props: TProps): ReactCompatNode | (props: TProps): { function render(): ReactCompatNode }, props?: TProps, options?: RootRuntimeOptions): stringRenders a React-compatible component to an HTML string.FunctionstartTransitionfunction startTransition(scope: TransitionScope): voidSchedules non-urgent updates produced inside a transition scope.FunctionunmountComponentAtNodefunction unmountComponentAtNode(container: Element): booleanUnmounts a legacy root from a container and reports whether anything was removed.Functionunstable_useCacheRefreshfunction unstable_useCacheRefresh(): (): voidReturns a callback placeholder for refreshing the current cache boundary.Functionusefunction use<T>(usable: unknown): TReads a context-like value or suspends on a thenable until it resolves.FunctionuseActionStatefunction useActionState<TState, TPayload>(action: (previousState: TState, payload: TPayload): TState | Promise<TState>, initialState: TState): [TState, (payload: TPayload): void, boolean]Tracks state and pending status for an action that receives the previous state.FunctionuseCallbackfunction useCallback<T>(callback: T, deps?: readonly unknown[]): TMemoizes a callback reference until its dependency list changes.FunctionuseContextfunction useContext<T>(context: ReactCompatContextLike<T>): TReads the current value for a React-compatible context.FunctionuseDebugValuefunction useDebugValue(_value: unknown, _format?: (value: unknown): unknown): voidRecords a value for React DevTools hook inspection.FunctionuseDeferredValuefunction useDeferredValue<T>(value: T, initialValue?: T): TDefers a value update so urgent renders can commit first.FunctionuseEffectfunction useEffect(callback: EffectCallback, deps?: readonly unknown[]): voidRuns an effect after the rendered output has been committed.FunctionuseEffectEventfunction useEffectEvent<TArgs, TResult>(callback: (...args: TArgs): TResult): (...args: TArgs): TResultCreates a stable event callback that always calls the latest implementation.FunctionuseIdfunction useId(): stringReturns a stable id string that matches server and client rendering.FunctionuseImperativeHandlefunction useImperativeHandle<T>(ref: unknown, create: (): T, deps?: readonly unknown[]): voidAssigns a custom imperative handle to a forwarded ref.FunctionuseInsertionEffectfunction useInsertionEffect(callback: EffectCallback, deps?: readonly unknown[]): voidRuns an insertion effect before layout effects are flushed.FunctionuseLayoutEffectfunction useLayoutEffect(callback: EffectCallback, deps?: readonly unknown[]): voidRuns a layout effect after DOM mutations and before normal effects.FunctionuseMemofunction useMemo<T>(factory: (): T, deps?: readonly unknown[]): TMemoizes a computed value until its dependency list changes.FunctionuseOptimisticfunction useOptimistic<TState, TPayload>(state: TState, update?: (state: TState, payload: TPayload): TState): [TState, (payload: TPayload): void]Returns an optimistic state value and dispatcher layered on top of a base state.FunctionuseReducerfunction useReducer<TState, TAction, TInitial>(reducer: (state: TState, action: TAction): TState, initialArg: TInitial, init?: (initialArg: TInitial): TState): [TState, (action: TAction): void]Stores reducer-managed component state and returns the current state with a dispatch function.FunctionuseReffunction useRef<T>(initial: T): { current: T }Returns a stable mutable ref object for the component instance.FunctionuseStatefunction useState<T>(initial: T | (): T): [T, (value: T | (previous: T): T): void]Stores component-local state and returns the current value with an updater.FunctionuseSyncExternalStorefunction useSyncExternalStore<T>(subscribe: (listener: (): void): (): void, getSnapshot: (): T, getServerSnapshot?: (): T): TSubscribes to an external store with snapshot checks for consistent rendering.FunctionuseTransitionfunction useTransition(): [boolean, StartTransition]Returns transition pending state and a function that starts transition work.

Interface

InterfaceComponentinterface ComponentBase class-style component contract with state updates and render lifecycle.InterfaceErrorBoundaryOptionsinterface ErrorBoundaryOptionsOptions used to render and observe a React-compatible error boundary.InterfaceEventHydrationManifestinterface EventHydrationManifestSerialized map of server-rendered event handlers used for hydration replay.InterfaceEventHydrationManifestEntryinterface EventHydrationManifestEntrySingle event handler entry in a hydration replay manifest.InterfaceHydrateRootOptionsinterface HydrateRootOptionsOptions used when hydrating server-rendered markup.InterfaceHydrationRecoverableErrorInfointerface HydrationRecoverableErrorInfoDetails passed to recoverable hydration error callbacks.InterfacePureComponentinterface PureComponentClass-style component contract that skips updates for shallow-equal props and state.InterfaceReactCompatElementinterface ReactCompatElementReact-compatible element record produced by createElement and JSX transforms.InterfaceReactCompatRenderableElementinterface ReactCompatRenderableElementElement-shaped renderable value accepted regardless of its original prop shape.InterfaceRootinterface RootRoot controller returned by createRoot and hydrateRoot.InterfaceRootOptionsinterface RootOptionsOptions used when creating a client render root.InterfaceSelectiveHydrationBoundaryinterface SelectiveHydrationBoundaryElement and options used to hydrate one selective boundary.InterfaceSelectiveHydrationOptionsinterface SelectiveHydrationOptionsRules that choose which boundary to hydrate after a captured event.InterfaceStreamingHydrationRootinterface StreamingHydrationRootController for deferred or selective streaming hydration.InterfaceStreamingHydrationRootOptionsinterface StreamingHydrationRootOptionsOptions for creating a streaming hydration root.

Namespace

Namespacedefaultconst default: unknownDefault React-compatible namespace export for @reckona/mreact.NamespaceJSXconst JSX: unknownJSX namespace types used by the React-compatible entrypoint.

Re-export

Re-exportFormEventconst FormEvent: unknownDOM and form event types exported by the JSX runtime.Re-exportFormEventHandlerconst FormEventHandler: unknownDOM and form event types exported by the JSX runtime.Re-exportJSXEventconst JSXEvent: unknownDOM and form event types exported by the JSX runtime.Re-exportJSXEventHandlerconst JSXEventHandler: unknownDOM and form event types exported by the JSX runtime.

Type Alias

Type AliasComponentTypetype ComponentType = FunctionComponent<P>Component type accepted by JSX and createElement.Type AliasElementTypetype ElementType = string | typeof Fragment | typeof Suspense | typeof SuspenseList | typeof Activity | typeof Profiler | typeof ERROR_BOUNDARY_TYPE | typeof STRICT_MODE_TYPE | ReactCompatContextProviderShorthand | ReactCompatProviderType | ForwardRefType<P> | MemoType<P> | LazyType<P> | (props: P): ReactCompatNode | PromiseLike<ReactCompatNode> | (props: P): { function render(): ReactCompatNode }Element type accepted by createElement, JSX, and renderer entrypoints.Type AliasFCtype FC = FunctionComponent<P>Alias for FunctionComponent.Type AliasFunctionComponenttype FunctionComponent = (props: P): ReactElement | nullFunction component signature accepted by the React-compatible runtime.Type AliasReactCompatNodetype ReactCompatNode = ReactCompatRenderableElement | ReactCompatPortal | string | number | boolean | null | undefined | ReactCompatNode[]Renderable value accepted by the React-compatible renderer.Type AliasReactElementtype ReactElement = ReactCompatElement & { props: P; type: T }React-compatible element object with typed props and element type.Type AliasReactNodetype ReactNode = ReactCompatNodeValues that can be rendered by the React-compatible runtime.Type AliasStartTransitiontype StartTransition = (scope: TransitionScope): voidFunction that schedules a transition scope.Type AliasTransitionScopetype TransitionScope = (): voidCallback body scheduled as transition work.

Variable

VariableActivityconst Activity: unique symbolSymbol used to mark activity boundaries in React-compatible trees.VariableChildrenconst Children: { function count(children: ReactCompatNode): number; function forEach(children: ReactCompatNode, fn: (child: string | number | ReactCompatRenderableElement | ReactCompatPortal | ReactCompatNode[], index: number): void): void; function map<T>(children: ReactCompatNode, fn: (child: string | number | ReactCompatRenderableElement | ReactCompatPortal | ReactCompatNode[], index: number): T): T[] | null; function only(children: ReactCompatNode): string | number | ReactCompatRenderableElement | ReactCompatPortal | ReactCompatNode[]; function toArray(children: ReactCompatNode): string | number | ReactCompatRenderableElement | ReactCompatPortal | ReactCompatNode[][] }Helpers for iterating, counting, flattening, and validating children.VariableComponentconst Component: ComponentConstructorBase class-style component constructor for React-compatible class components.VariableFragmentconst Fragment: unique symbolSymbol used to group JSX children without adding a host element.VariableisValidElementconst isValidElement: typeof isReactCompatElementAlias for checking whether a value is a React-compatible element.VariableProfilerconst Profiler: unique symbolSymbol used to measure render work with profiler callbacks.VariablePureComponentconst PureComponent: PureComponentConstructorClass-style component constructor with shallow prop and state comparison.VariableStrictModeconst StrictMode: symbolSymbol used to mark a subtree for strict-mode development checks.VariableSuspenseconst Suspense: unique symbolSymbol used to suspend rendering while async content resolves.VariableSuspenseListconst SuspenseList: unique symbolSymbol used to coordinate multiple suspense boundaries.Variableversionconst version: "19.2.6"React version string matched by the compatibility layer.