Skip to content

Commit

Permalink
Explicit mention that the server needs to import custom elements
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewJakubowicz committed Nov 20, 2023
1 parent dae25f5 commit 634d16f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/lit-dev-content/site/docs/v3/ssr/server-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ Typically `value` is a `TemplateResult` produced by a Lit template expression, l
html`<h1>Hello</h1>`
```

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

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

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

```ts
import './my-element.js';

const result = render(html`<my-element></my-element>`);
```

Expand Down

0 comments on commit 634d16f

Please sign in to comment.