Reference
React compatibility
The documented React-shaped subset and how each surface behaves under Vidact.
Vidact compiles a subset of React 19. This page summarizes what is in that subset, what needs a feature flag, what behaves differently, and what is rejected. Compatibility remains source-shape and target specific; a package or component is certified only to the level exercised by its repository tests.
How to read the tables
| Status | Meaning |
|---|---|
| Supported | Works in compiled source subject to the documented notes |
| Opt-in | Works when the named feature is enabled |
| Adapted | Works for the same purpose, with a documented difference |
| Server / Hydrate | Available only in that build target |
| Rejected | Compile-time error; there is no fallback |
| Tracked | React canary API with no stability promise yet |
Components
| API | Status | Notes |
|---|---|---|
| Function components | Supported | Run once per mount |
| Arrow, expression, default-export components | Supported | |
| Custom hooks | Supported | Must be in the same module as the caller |
| Class components | Rejected | Use functions |
| JSX, fragments, arrays, conditionals | Supported | |
key | Supported | Must be a primitive; duplicates throw |
ref as a prop | Supported | |
forwardRef | Adapted | Inline component functions only, as a migration aid |
memo | Adapted | Accepted; no custom comparator; not a performance tool |
createElement | Adapted | Statically known elements compile; a runtime element type renders through the runtime |
createPortal | Adapted | Client only; events bubble through the physical DOM |
lazy, Suspense | Opt-in async | |
Activity | Opt-in retained-ui | |
StrictMode | Adapted | Accepted; no double invocation |
Profiler | Opt-in profiling | Reports Vidact work, not render time |
ViewTransition, Fragment refs | Tracked |
Hooks
| Hook | Status | Notes |
|---|---|---|
useState | Supported | |
useReducer | Supported | |
useRef | Supported | |
useImperativeHandle | Supported | |
useEffect, useLayoutEffect | Supported | Pass a dependency array |
useEffectEvent | Supported | |
useInsertionEffect | Opt-in css-insertion | |
useMemo, useCallback | Supported | Identity preserved where observable; not a performance tool |
useId | Supported | Stable across server and client |
useContext, use(context) | Supported | |
use(promise) | Opt-in async | |
useSyncExternalStore | Supported | |
useTransition, useDeferredValue | Opt-in concurrent | |
useActionState, useOptimistic | Opt-in actions | |
useFormStatus | Opt-in actions | |
useDebugValue | Opt-in profiling |
DOM and events
| Feature | Status | Notes |
|---|---|---|
| HTML, SVG, MathML, custom elements | Supported | Namespaces handled automatically |
Attributes, properties, style objects, spreads | Supported | Spreads are reactive |
| Event handlers | Adapted | Native DOM events, no synthetic layer; unknown event props are rejected |
Capture handlers (onClickCapture) | Supported | |
| Controlled forms | Supported | onChange timing matches React |
Function form action | Opt-in actions | |
dangerouslySetInnerHTML | Opt-in unsafe-html | |
| Host and callback refs | Supported |
Roots and rendering
| API | Status | Notes |
|---|---|---|
createRoot(host).render(element) | Adapted | Use mountCompiled(Component, host) or createRoot(host).mount(Component) |
hydrateRoot | Hydrate | Takes a component, not an element |
renderToString, renderToStaticMarkup | Server | |
renderToReadableStream, renderToPipeableStream | Server + framework | |
prerender, resume | Server + framework | |
| Error boundaries | Adapted | errorBoundary() function plus root callbacks |
flushSync | Opt-in concurrent | |
startTransition | Opt-in concurrent | |
Resource hints (preload, preinit, …) | Opt-in framework | |
cache | Opt-in framework, server only | |
| Server Components and Server Functions | Opt-in framework | Explicit manifests; not React Flight |
Element utilities
| API | Status | Notes |
|---|---|---|
Children.toArray | Adapted | Accepts one compiled value |
Other Children utilities | Rejected | |
cloneElement | Adapted | Compiled values only |
isValidElement | Adapted | Tests for a compiled value |
createRef | Rejected | Use useRef or ref-as-prop |
findDOMNode, legacy roots | Rejected | |
| React DevTools | Rejected | No Fiber to inspect |
Testing
| API | Status | Notes |
|---|---|---|
act | Supported | From @vidact/test-support |
Third-party packages
A package is eligible for Vidact compilation when its reachable code stays inside this subset. The Vite plugin detects React dependencies from package metadata and recognizes both JSX and published react/jsx-runtime calls. Packages that depend on rejected APIs or React internals fail at build time.
Successful compilation does not certify an entire package. The browser corpus exercises selected @base-ui/react button, switch, and accordion interactions. Other components and combinations need their own tests, including hydration and keyboard behavior. Run the paths your application uses against the package versions you intend to ship.