@@ -30,6 +30,7 @@ The template can contain custom elements. If the custom elements are defined on
30
30
31
31
``` ts
32
32
import {render } from ' @lit-labs/ssr' ;
33
+ import {html } from ' lit' ;
33
34
// Import `my-element` on the server to server render it.
34
35
import ' ./my-element.js' ;
35
36
@@ -42,6 +43,7 @@ const result = render(html`
42
43
To render a single element, you render a template that only contains that element:
43
44
44
45
``` ts
46
+ import {html } from ' lit' ;
45
47
import ' ./my-element.js' ;
46
48
47
49
const result = render (html ` <my-element></my-element> ` );
@@ -72,6 +74,7 @@ This is the preferred way to handle SSR results when integrating with a streamin
72
74
``` ts
73
75
import {render } from ' @lit-labs/ssr' ;
74
76
import {RenderResultReadable } from ' @lit-labs/ssr/lib/render-result-readable.js' ;
77
+ import {html } from ' lit' ;
75
78
76
79
// Using Koa to stream
77
80
app .use (async (ctx ) => {
@@ -91,9 +94,10 @@ app.use(async (ctx) => {
91
94
``` ts
92
95
import {render } from ' @lit-labs/ssr' ;
93
96
import {collectResult } from ' @lit-labs/ssr/lib/render-result.js' ;
97
+ import {html } from ' lit' ;
94
98
95
99
const result = render (html ` <my-element></my-element> ` );
96
- const html = await collectResult (result );
100
+ const contents = await collectResult (result );
97
101
```
98
102
99
103
#### ` collectResultSync() `
@@ -107,10 +111,11 @@ Because this function doesn't support async rendering, it's recommended to only
107
111
``` ts
108
112
import {render } from ' @lit-labs/ssr' ;
109
113
import {collectResultSync } from ' @lit-labs/ssr/lib/render-result.js' ;
114
+ import {html } from ' lit' ;
110
115
111
116
const result = render (html ` <my-element></my-element> ` );
112
117
// Throws if `result` contains a Promise!
113
- const html = collectResultSync (result );
118
+ const contents = collectResultSync (result );
114
119
```
115
120
116
121
### Render options
0 commit comments