|
10 | 10 |
|
11 | 11 | ### Options — `RenderToFlightStringOptions` |
12 | 12 |
|
13 | | -| Field | Type | Meaning | |
14 | | -| ----------- | ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
15 | | -| `request` | `Request \| string` | The request the render runs under: a `Request`, or a URL string (absolute or path). Defaults to `http://localhost/`. A component reading `getRequestContext()` sees this request's url/cookies. When a `Request` is passed, its headers are used and `headers` is ignored. | |
16 | | -| `headers` | `HeadersInit` | Request headers (e.g. Cookie) visible to the server tree, used only when `request` is a string. | |
17 | | -| `env` | `unknown` | Env / bindings exposed as `ctx.env`. Defaults to `{}`. | |
18 | | -| `params` | `Record<string, string>` | Route params exposed via `ctx.params` and loader contexts. | |
19 | | -| `routeName` | `string` | Matched route name (drives `ctx.routeName` and scoped reverse). | |
20 | | -| `vars` | `VarsInit` | Variables a prior middleware would have set, visible via `ctx.get(...)`. Object form (`{ user }`) or `[key, value]` tuples (`[[userVar, u]]`). | |
| 13 | +| Field | Type | Meaning | |
| 14 | +| ----------- | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 15 | +| `request` | `Request \| string` | The request the render runs under: a `Request`, or a URL string (absolute or path). Defaults to `http://localhost/`. A component reading `getRequestContext()` sees this request's url/cookies. When a `Request` is passed, its headers are used and `headers` is ignored. | |
| 16 | +| `headers` | `HeadersInit` | Request headers (e.g. Cookie) visible to the server tree, used only when `request` is a string. | |
| 17 | +| `env` | `unknown` | Env / bindings exposed as `ctx.env`. Defaults to `{}`. | |
| 18 | +| `params` | `Record<string, string>` | Route params exposed via `ctx.params` and loader contexts. | |
| 19 | +| `routeName` | `string` | Matched route name (drives `ctx.routeName` and scoped reverse). | |
| 20 | +| `routeMap` | `Record<string, string>` | Route name -> pattern map scoping `ctx.reverse()` (like `renderHandler`). Without it, a component that reverses resolves against the GLOBAL route map and is order-dependent on whatever router registered last. Pass the router-under-test's map for deterministic reverse. | |
| 21 | +| `vars` | `VarsInit` | Variables a prior middleware would have set, visible via `ctx.get(...)`. Object form (`{ user }`) or `[key, value]` tuples (`[[userVar, u]]`). | |
21 | 22 |
|
22 | 23 | ### Context — `RequestContext` (what your component receives) |
23 | 24 |
|
|
0 commit comments