Skip to content

Commit

Permalink
Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-…
Browse files Browse the repository at this point in the history
…breaking-changes.md
  • Loading branch information
Rich-Harris authored Nov 14, 2023
1 parent 15349e1 commit fc429e0
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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).

0 comments on commit fc429e0

Please sign in to comment.