# Feature catalog — preactjs/preact

> Canonical page: https://codevetter.com/unpack/preact/feature-catalog

# Feature catalog — preactjs/preact

Scanned commit 45728eb4315bcb22c5d50b8fec0bbac419eaa799 (2026-10-02). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The primary user-facing surface is a library API for constructing and updating interfaces. Core provides components, DOM rendering, hydration, context, fragments, refs, and portals; addons provide hooks, React adapters, diagnostics, and test controls. Compiler-facing exports support both automatic JSX and precompiled HTML templates. The demo exposes a route-based playground for rendering scenarios and ecosystem integrations; it is documented as a debugging application.
- createElement and cloneElement normalize props and variadic children, extract keys, and extract refs for non-function element types; Fragment returns its children. — [src/create-element.js#L16-33](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/create-element.js#L16-L33) [src/create-element.js#L44-68](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/create-element.js#L44-L68) [src/create-element.js#L108-114](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/create-element.js#L108-L114)
- Class components support setState, forceUpdate, derived state, mount/update callbacks, shouldComponentUpdate, and snapshot-before-update behavior. — [src/component.js#L35-77](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/component.js#L35-L77) [src/diff/index.js#L163-175](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/diff/index.js#L163-L175) [src/diff/index.js#L183-256](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/diff/index.js#L183-L256) [src/diff/index.js#L296-302](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/diff/index.js#L296-L302)
- Hydration reuses matching existing DOM nodes, attaches function-valued props, reports missing-node mismatches through an option hook, and specially synchronizes textarea values. — [src/render.js#L69-77](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/render.js#L69-L77) [src/diff/index.js#L549-583](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/diff/index.js#L549-L583) [src/diff/index.js#L634-652](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/diff/index.js#L634-L652) [src/diff/index.js#L697-716](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/diff/index.js#L697-L716)
- createContext provides Provider and Consumer interfaces, default values, and subscriptions that force consumer updates when the provider value changes. — [src/create-context.js#L6-49](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/create-context.js#L6-L49)
- createPortal continues a VNode subtree in another DOM container; compat adds containerInfo to the returned node. — [src/create-portal.js#L9-19](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/create-portal.js#L9-L19) [compat/src/portals.js#L8-11](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/portals.js#L8-L11)
- preact/hooks implements useState/useReducer, passive and layout effects, refs, imperative handles, memoization, callbacks, context, debug values, error boundaries, and stable per-root IDs. — [hooks/src/index.js#L200-229](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/hooks/src/index.js#L200-L229) [hooks/src/index.js#L281-338](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/hooks/src/index.js#L281-L338) [hooks/src/index.js#L347-399](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/hooks/src/index.js#L347-L399) [hooks/src/index.js#L407-442](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/hooks/src/index.js#L407-L442)
- React compatibility includes Children utilities, PureComponent, memo with a custom comparator, forwardRef, DOM lookup, unmounting, flushSync, and StrictMode as a Fragment alias. — [compat/src/index.js#L104-123](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/index.js#L104-L123) [compat/src/index.js#L134-151](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/index.js#L134-L151) [compat/src/index.js#L166-202](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/index.js#L166-L202) [compat/src/memo.js#L11-30](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/memo.js#L11-L30)
- Compat supplies Suspense and lazy, use for promises or context, and useSyncExternalStore with separate server/hydration snapshots. — [compat/src/suspense.js#L136-200](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/suspense.js#L136-L200) [compat/src/suspense.js#L241-276](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/suspense.js#L241-L276) [compat/src/render.js#L39-76](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/render.js#L39-L76) [compat/src/render.js#L346-385](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/render.js#L346-L385)
- Compat client adapters expose createRoot with render/unmount and hydrateRoot; server adapters expose string/static-markup and stream interfaces. — [compat/client.mjs#L3-24](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/client.mjs#L3-L24) [compat/server.mjs#L5-17](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/server.mjs#L5-L17) [compat/server.browser.js#L1-11](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/server.browser.js#L1-L11)
- The JSX runtime exports jsx, jsxs, jsxDEV, Fragment, jsxTemplate, jsxAttr, and jsxEscape; template helpers serialize attributes and escape dynamic children. — [jsx-runtime/src/index.js#L81-86](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/jsx-runtime/src/index.js#L81-L86) [jsx-runtime/src/index.js#L113-149](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/jsx-runtime/src/index.js#L113-L149) [jsx-runtime/src/index.js#L158-191](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/jsx-runtime/src/index.js#L158-L191)
- Debug validates render containers, element types, refs, event-handler values, hook placement, excessive rerenders, and duplicate keys; devtools exposes an attachment bridge and custom hook names. — [debug/src/debug.js#L121-207](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/debug/src/debug.js#L121-L207) [debug/src/debug.js#L249-282](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/debug/src/debug.js#L249-L282) [debug/src/debug.js#L448-470](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/debug/src/debug.js#L448-L470) [devtools/src/index.js#L1-15](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/devtools/src/index.js#L1-L15)
- The demo route table exposes Home, state-order, reorder, spiral, pythagoras, todo, fragments, profiler, key_bug, context, devtools, suspense, empty-fragment, people profiles, styled-components, Redux, MobX, textfields, reduxBug, suspense-router, nested-suspense, contenteditable, Zustand, and Redux Toolkit. — [demo/index.jsx#L149-178](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/demo/index.jsx#L149-L178) [CONTRIBUTING.md#L67-69](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/CONTRIBUTING.md#L67-L69)
- The Todo demo supports text entry, addition, and removal; People Browser supports name/ID sorting, profile navigation, and delayed contact removal using an in-memory MobX store. — [demo/todo.jsx#L5-45](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/demo/todo.jsx#L5-L45) [demo/people/index.tsx#L19-53](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/demo/people/index.tsx#L19-L53) [demo/people/store.ts#L60-73](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/demo/people/store.ts#L60-L73) [demo/people/profile.tsx#L49-58](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/demo/people/profile.tsx#L49-L58)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
