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

pull/9444/head
Rich Harris 11 months ago committed by GitHub
parent 15349e1cc4
commit fc429e0a29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -74,4 +74,10 @@ If you have a `contenteditable` node with a corresponding binding _and_ a reacti
### `oneventname` attributes no longer accept string values
In Svelte 4, it was possible to specify HTML event attributes like `<button onclick="foo">`. However, this is no longer allowed in Svelte 5.
In Svelte 4, it was possible to specify event attributes on HTML elements as a string:
```svelte
<button onclick="alert('hello')">...</button>
```
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).

Loading…
Cancel
Save