Skip to content

Commit 797e577

Browse files
[docs] mention that server should import custom element definitions to server render them (#1271)
1 parent dae25f5 commit 797e577

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/lit-dev-content/site/docs/v3/ssr/server-usage.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ Typically `value` is a `TemplateResult` produced by a Lit template expression, l
2626
html`<h1>Hello</h1>`
2727
```
2828

29-
The template can contain custom elements, which are rendered in turn, along with their templates.
29+
The template can contain custom elements. If the custom elements are defined on the server, they'll be rendered in turn, along with their templates.
3030

3131
```ts
3232
import {render} from '@lit-labs/ssr';
33+
// Import `my-element` on the server to server render it.
34+
import './my-element.js';
3335

3436
const result = render(html`
3537
<h1>Hello SSR!</h1>
@@ -40,6 +42,8 @@ const result = render(html`
4042
To render a single element, you render a template that only contains that element:
4143

4244
```ts
45+
import './my-element.js';
46+
4347
const result = render(html`<my-element></my-element>`);
4448
```
4549

0 commit comments

Comments
 (0)