# Extension points — preactjs/preact

> Canonical page: https://codevetter.com/unpack/preact/extension-points

# Extension points — 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.

Preact's main extension mechanism is the shared options object, rather than an application plugin registry. Renderer callbacks let addons intercept VNode creation, rendering, commits, errors, events, and teardown. Components, context providers, memo comparators, lazy loaders, and external-store subscribers supply narrower behavior contracts. Packaging and demo routes have explicit lists that must be updated when adding a new surface.
- Public Options declares vnode, unmount, diffed, event, requestAnimationFrame, debounceRendering, debug-value, hook-name, and attribute-serialization hooks. — [src/index.d.ts#L305-324](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/index.d.ts#L305-L324) [src/options.js#L3-16](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/options.js#L3-L16)
- Internal Options adds _root, _diff, _commit, _render, _hook, _skipEffects, _catchError, and _hydrationMismatch contracts. — [src/internal.d.ts#L27-51](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/internal.d.ts#L27-L51)
- Hooks demonstrates callback composition by capturing old options handlers and delegating to them; extensions should follow this existing chaining contract. — [hooks/src/index.js#L32-56](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/hooks/src/index.js#L32-L56) [hooks/src/index.js#L90-123](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/hooks/src/index.js#L90-L123)
- options.debounceRendering overrides component queue scheduling, and options.requestAnimationFrame overrides passive-effect flushing. — [src/component.js#L206-215](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/component.js#L206-L215) [hooks/src/index.js#L513-517](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/hooks/src/index.js#L513-L517)
- Component classes extend lifecycle and error-boundary behavior through render, shouldComponentUpdate, getChildContext, getDerivedStateFromError, and componentDidCatch. — [src/diff/index.js#L206-215](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/diff/index.js#L206-L215) [src/diff/index.js#L267-294](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/diff/index.js#L267-L294) [src/diff/catch-error.js#L26-48](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/diff/catch-error.js#L26-L48)
- memo accepts a custom equality comparator; lazy accepts an asynchronous loader resolving to a default export or component. — [compat/src/memo.js#L11-25](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/memo.js#L11-L25) [compat/src/suspense.js#L241-272](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/suspense.js#L241-L272)
- useSyncExternalStore integrates external state through subscribe/getSnapshot/getServerSnapshot callbacks and uses the subscription return value as effect cleanup. — [compat/src/render.js#L39-76](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/compat/src/render.js#L39-L76)
- options.attr can customize compiler-generated attribute serialization, and addHookName forwards labels through options._addHookName. — [jsx-runtime/src/index.js#L113-117](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/jsx-runtime/src/index.js#L113-L117) [devtools/src/index.js#L10-14](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/devtools/src/index.js#L10-L14) [src/index.d.ts#L320-324](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/index.d.ts#L320-L324)
- A new shipped addon must join PACKAGES and supply source/module manifest metadata; the root exports and files lists determine consumer resolution and tarball inclusion. — [scripts/build.mjs#L23-31](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/scripts/build.mjs#L23-L31) [scripts/build.mjs#L204-215](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/scripts/build.mjs#L204-L215) [package.json#L14-87](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/package.json#L14-L87) [package.json#L122-158](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/package.json#L122-L158)
- New demo surfaces plug into imports, navigation links, and Router children in demo/index.jsx; the People router additionally accepts Route component or render callbacks. — [demo/index.jsx#L1-29](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/demo/index.jsx#L1-L29) [demo/index.jsx#L74-88](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/demo/index.jsx#L74-L88) [demo/index.jsx#L149-178](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/demo/index.jsx#L149-L178) [demo/people/router.tsx#L68-96](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/demo/people/router.tsx#L68-L96)
- Type extensions operate through exported VNode/component/attribute interfaces and SignalLike/Signalish contracts; declaration fixtures exercise custom typed DOM attributes. — [src/index.d.ts#L13-21](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/index.d.ts#L13-L21) [src/index.d.ts#L57-70](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/index.d.ts#L57-L70) [src/dom.d.ts#L54-62](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/src/dom.d.ts#L54-L62) [test/ts/dom-attributes.test-d.tsx#L1-28](https://github.com/preactjs/preact/blob/45728eb4315bcb22c5d50b8fec0bbac419eaa799/test/ts/dom-attributes.test-d.tsx#L1-L28)

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)
