Skip to main content
@juo/blocks/preact mirrors the React adapter but uses Preact’s renderer and hook runtime. Use it for the React-style component model with a smaller payload — typical for checkout extensions and theme overlays.
The patterns below extend the Blocks, Reactivity, and Contexts concept pages with Preact-specific equivalents.

Defining a Preact block

Reading services with useContext

Identical surface to the React adapter — useContext returns a proxy that exposes signals as [value, setValue] tuples:

useSignal

Providing contexts

React vs Preact

The two adapters expose the same APIs. Choose Preact when:
  • A smaller bundle is needed (checkout UI extensions, theme widgets).
  • The project is already in a Preact context (some Shopify surfaces).
  • React-only ecosystem packages aren’t required.
Otherwise, prefer React for broader ecosystem compatibility.