Skip to content

Commit

Permalink
docs: use e.detail instead of e.details in migration examples (#14340)
Browse files Browse the repository at this point in the history
  • Loading branch information
ewen-lbh authored Nov 17, 2024
1 parent 396ea2e commit 24ebbcb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions documentation/docs/07-misc/07-v5-migration-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,11 @@ This function is deprecated in Svelte 5. Instead, components should accept _call
<Pump
---on:---inflate={(power) => {
size += power---.details---;
size += power---.detail---;
if (size > 75) burst = true;
}}
---on:---deflate={(power) => {
if (size > 0) size -= power---.details---;
if (size > 0) size -= power---.detail---;
}}
/>
Expand Down Expand Up @@ -317,7 +317,7 @@ When spreading props, local event handlers must go _after_ the spread, or they r
> - import the function
> - call the function to get a dispatch function
> - call said dispatch function with a string and possibly a payload
> - retrieve said payload on the other end through a `.details` property, because the event itself was always a `CustomEvent`
> - retrieve said payload on the other end through a `.detail` property, because the event itself was always a `CustomEvent`
>
> It was always possible to use component callback props, but because you had to listen to DOM events using `on:`, it made sense to use `createEventDispatcher` for component events due to syntactical consistency. Now that we have event attributes (`onclick`), it's the other way around: Callback props are now the more sensible thing to do.
>
Expand Down

0 comments on commit 24ebbcb

Please sign in to comment.