You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -50,13 +55,21 @@ export type AddServerRenderer =
50
55
51
56
### `streaming` option
52
57
53
-
**Type:**`boolean`
58
+
<p>
59
+
60
+
**Type:**`boolean`<br />
61
+
**Default:**`false`
62
+
</p>
54
63
55
64
Enables rendering components using [HTML streaming](/en/guides/on-demand-rendering/#html-streaming).
56
65
57
66
### `renderers` option
58
67
59
-
**Type:**`AddServerRenderer[]`
68
+
<p>
69
+
70
+
**Type:**`AddServerRenderer[]`<br />
71
+
**Default:**`[]`
72
+
</p>
60
73
61
74
A list of loaded client renderers required by the component. Use this if your `.astro` component renders any [UI framework components](/en/guides/framework-components/) or MDX using an official Astro integration (e.g. React, Vue, etc.).
62
75
@@ -106,15 +119,20 @@ import vueRenderer from "@astrojs/vue/server.js";
This function renders a specified component inside a container. It takes an Astro component as an argument and it returns a string that represents the HTML/content rendered by the Astro component.
119
137
120
138
```js
@@ -131,6 +149,11 @@ It also accepts an object as a second argument that can contain a [number of opt
It renders a component, and it returns a `Response` object.
135
158
136
159
```js
@@ -154,15 +177,19 @@ export type ContainerRenderOptions = {
154
177
request?:Request;
155
178
params?:Record<string, string|undefined>;
156
179
locals?:App.Locals;
157
-
routeType?:"page"|"endpoint";
180
+
routeType?:RouteType;
181
+
partial?:boolean;
158
182
};
159
183
```
160
184
161
185
These optional values can be passed to the rendering function in order to provide additional information necessary for an Astro component to properly render.
162
186
163
187
### `slots`
164
188
165
-
**Type:**`Record<string, any>`
189
+
<p>
190
+
191
+
**Type**: `Record<string, any>`
192
+
</p>
166
193
167
194
An option to pass content to be rendered with [`<slots>`](/en/basics/astro-components/#slots).
168
195
@@ -224,7 +251,10 @@ const result = await container.renderToString(Card, {
224
251
225
252
### `props` option
226
253
227
-
**Type:**`Record<string, unknown>`
254
+
<p>
255
+
256
+
**Type**: `Record<string, unknown>`
257
+
</p>
228
258
229
259
An option to pass [properties](/en/basics/astro-components/#component-props) for Astro components.
230
260
@@ -252,7 +282,10 @@ const { name } = Astro.props;
252
282
253
283
### `request` option
254
284
255
-
**Type:**`Request`
285
+
<p>
286
+
287
+
**Type**: `Request`
288
+
</p>
256
289
257
290
An option to pass a `Request` with information about the path/URL the component will render.
258
291
@@ -274,7 +307,10 @@ const result = await container.renderToString(Card, {
274
307
275
308
### `params` option
276
309
277
-
**Type:**`Record<string, string | undefined>`
310
+
<p>
311
+
312
+
**Type**: `Record<string, string | undefined>`
313
+
</p>
278
314
279
315
An object to pass information about the path parameter to an Astro component responsible for [generating dynamic routes](/en/guides/routing/#dynamic-routes).
280
316
@@ -300,7 +336,10 @@ const result = await container.renderToString(LocaleSlug, {
300
336
301
337
### `locals` options
302
338
303
-
**Type:**`App.Locals`
339
+
<p>
340
+
341
+
**Type**: `App.Locals`
342
+
</p>
304
343
305
344
An option to pass information from [`Astro.locals`](/en/reference/api-reference/#locals) for rendering your component.
0 commit comments