From 2a0097e4eef8ba09f72f1eef5c5e2420b466f8bc Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Wed, 3 Jan 2024 16:31:22 +0100 Subject: [PATCH] docs: note null/undefined breaking change closes #10043 --- .../routes/docs/content/03-appendix/02-breaking-changes.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md b/sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md index a92d5d68d..156104a12 100644 --- a/sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md +++ b/sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md @@ -107,3 +107,7 @@ In Svelte 4, it was possible to specify event attributes on HTML elements as a s ``` This is not recommended, and is no longer possible in Svelte 5, where properties like `onclick` replace `on:click` as the mechanism for adding [event handlers](/docs/event-handlers). + +### `null` and `undefined` become the empty string + +In Svelte 4, `null` and `undefined` were printed as the corresponding string. In 99 out of 100 cases you want this to become the empty string instead, which is also what most other frameworks out there do. Therefore, in Svelte 5, `null` and `undefined` become the empty string.