Skip to content

Commit fc429e0

Browse files
authored
Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md
1 parent 15349e1 commit fc429e0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,10 @@ If you have a `contenteditable` node with a corresponding binding _and_ a reacti
7474

7575
### `oneventname` attributes no longer accept string values
7676

77-
In Svelte 4, it was possible to specify HTML event attributes like `<button onclick="foo">`. However, this is no longer allowed in Svelte 5.
77+
In Svelte 4, it was possible to specify event attributes on HTML elements as a string:
78+
79+
```svelte
80+
<button onclick="alert('hello')">...</button>
81+
```
82+
83+
This is considered an anti-pattern 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).

0 commit comments

Comments
 (0)