Skip to content

Commit

Permalink
docs: add csr warning list (#11130)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunbinseo committed Dec 1, 2023
1 parent 1926f4b commit 98e4b8f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion documentation/docs/20-core-concepts/40-page-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ Normally, SvelteKit renders your page on the server first and sends that HTML to
```js
/// file: +page.js
export const ssr = false;
// If both `ssr` and `csr` are `false`, nothing will be rendered!
```

If you add `export const ssr = false` to your root `+layout.js`, your entire app will only be rendered on the client — which essentially means you turn your app into an SPA.
Expand All @@ -132,9 +133,15 @@ Ordinarily, SvelteKit [hydrates](glossary#hydration) your server-rendered HTML i
```js
/// file: +page.js
export const csr = false;
// If both `csr` and `ssr` are `false`, nothing will be rendered!
```

> If both `ssr` and `csr` are `false`, nothing will be rendered!
Disabling CSR does not ship any JavaScript to the client. This means:

* The webpage should work with HTML and CSS only.
* `<script>` tags inside all Svelte components are removed.
* `<form>` elements cannot be [progressively enhanced](form-actions#progressive-enhancement).
* Links are handled by the browser with a full-page navigation.

## trailingSlash

Expand Down

0 comments on commit 98e4b8f

Please sign in to comment.