Skip to content

Commit

Permalink
docs: note null/undefined breaking change
Browse files Browse the repository at this point in the history
closes #10043
  • Loading branch information
dummdidumm committed Jan 3, 2024
1 parent 2133d7d commit 2a0097e
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.

1 comment on commit 2a0097e

@vercel
Copy link

@vercel vercel bot commented on 2a0097e Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

svelte-5-preview – ./sites/svelte-5-preview

svelte-5-preview-git-main-svelte.vercel.app
svelte-5-preview.vercel.app
svelte-octane.vercel.app
svelte-5-preview-svelte.vercel.app

Please sign in to comment.