API reference > @kontsedal/olas-react
olas-react package
Functions
Function | Description |
|---|---|
Mint an independent context bound to a specific
ts Each call returns a *new* React context. The default | |
Server-side hydrator. Captures every committed write — a fetch resolving, a canonical Hydration, optimistic writes and rollbacks are not captured: the first is data the client already has, and the other two are a guess the server never confirmed and its undoing. A The payload is serialized with | |
Web-Streams transformer that interleaves A batch goes only where React's hydration never sees it: directly inside Pipe React's own stream through the transform, and put any HTML template of your own around its output. A template inside the transform puts the page inside an element the transform cannot tell from React's, and every batch waits for the end. Works in Node, the Edge runtime, Cloudflare Workers, Deno, and the browser — anywhere Web Streams are available. tsx The transformer drains one final time on close, so entries that settled after the last chunk still reach the client. A stream that ends inside markup gets no final batch, since no script can go there. | |
Hydration boundary for SSR: constructs a Usage: tsx The boundary **owns** the root: it is built during the first render, so the children can read hydrated data in that render. **Streaming.** The batches **Unmount, and a hidden **A render that never commits.** A child that suspends or throws before the boundary's first commit makes React discard the render, and the root with it. A retry of the same element reuses that root. A root no commit claims is disposed about ten seconds after its work goes idle, or after a minute if it never goes idle. A **SSR contract.** During server rendering, callers construct a per-request root and pass it to | |
Connect a live root to the streamed hydration entries. The root first receives every batch that has already arrived, then each new batch as the stream delivers it. Several roots can be installed at once. Returns the uninstall function. For a root built outside | |
Provides an Olas root to descendant components. The root is created once (typically in | |
Wrap a sub-tree so unmount calls **Cross-fade safe.** Multiple wrappers around the same controller are refcounted: **Shares its bookkeeping with | |
Subscribe to all signals on a | |
JSX-ready spread for binding a tsx For non-string fields, pass a tsx The returned | |
JSX-ready spread for a tsx | |
Subscribe a component to an infinite query subscription a controller made with tsx
| |
Subscribe a component to an infinite query subscription with Suspense. The hook suspends until the first page lands, with | |
Subscribe to all signals on a
The hook is a subscription layer: concurrency ( | |
Subscribe a component to an **Fine-grained.** The component re-renders only when a field it read during render changes. Pass
Refetches AFTER a first success do NOT re-suspend — only the initial load throws. | |
Subscribe a component to an | |
Resolve the root's public api from The return type is the root registered through | |
Auto-suspend a controller when The effect undoes itself on cleanup: if it is the reason the controller is suspended, it resumes before it goes. Unmounting a hidden tab's subtree — or swapping the It shares its bookkeeping with | |
Suspense-first variant of Sugar over | |
Subscribe to a single read-signal and return its current value. Any Built on Optional ts | |
Subscribe to a single read-signal and return its current value: a |
Interfaces
Interface | Description |
|---|---|
Register the app's root type once, and ts |
Variables
Variable | Description |
|---|---|
Bootstrap script that primes the client's intake queue *before* React's hydration runs. Drop the string into ts The intake is a tiny "push-only array". Batches land here, and a | |
Global key under which the client-side bootstrap stashes the queue of incoming dehydrated entries. Exposed as a constant so consumers writing custom serialization can match it. |
Type Aliases
Type Alias | Description |
|---|---|
Props of | |
| |
What | |
Props of | |
The api | |
Result of **Where the tag goes matters.** React writes its stream in fixed-size chunks, so a chunk boundary can fall inside a tag, an attribute value or a text node. A tsx | |
Options for | |
What | |
Props of | |
Options for | |
Props | |
What | |
What | |
Callbacks | |
What | |
What | |
What | |
What | |
Options for | |
Options for |