docs: use e.detail instead of e.details in migration examples (#14340)

pull/14344/head
Gwen Le Bihan 1 month ago committed by GitHub
parent 396ea2ef37
commit 24ebbcbbc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -169,11 +169,11 @@ This function is deprecated in Svelte 5. Instead, components should accept _call
<Pump <Pump
---on:---inflate={(power) => { ---on:---inflate={(power) => {
size += power---.details---; size += power---.detail---;
if (size > 75) burst = true; if (size > 75) burst = true;
}} }}
---on:---deflate={(power) => { ---on:---deflate={(power) => {
if (size > 0) size -= power---.details---; if (size > 0) size -= power---.detail---;
}} }}
/> />
@ -317,7 +317,7 @@ When spreading props, local event handlers must go _after_ the spread, or they r
> - import the function > - import the function
> - call the function to get a dispatch function > - call the function to get a dispatch function
> - call said dispatch function with a string and possibly a payload > - 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. > 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.
> >

Loading…
Cancel
Save