mirror of
https://github.com/sveltejs/svelte.git
synced 2024-12-01 17:30:59 +01:00
Fixes #3008: Better SSR docs
This commit is contained in:
parent
614393edcb
commit
d91e9afab6
@ -1019,8 +1019,12 @@ Unlike client-side components, server-side components don't have a lifespan afte
|
||||
|
||||
A server-side component exposes a `render` method that can be called with optional props. It returns an object with `head`, `html`, and `css` properties, where `head` contains the contents of any `<svelte:head>` elements encountered.
|
||||
|
||||
You can import a Svelte component directly into Node using [`svelte/register`](docs#svelte_register).
|
||||
|
||||
```js
|
||||
const App = require('./App.svelte');
|
||||
require('svelte/register');
|
||||
|
||||
const App = require('./App.svelte').default;
|
||||
|
||||
const { head, html, css } = App.render({
|
||||
answer: 42
|
||||
|
Loading…
Reference in New Issue
Block a user