You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<scriptlang="ts">
importtype { PageData } from"./$types"importSelectfrom"./Select.svelte"exportlet data:PageData$: console.log('change data', JSON.stringify(data))// valueA PATTERN// When valueA is changed, a change in data is detected (UNEXPECTED BEHAVIOR)let valueA:number$: { valueA=data.value }// valueB PATTERN// If valueB is changed, the change in data is not detected (EXPECTED BEHAVIOR)let valueB:numberconst setValueB = (v:number) => { valueB=v }$: { setValueB(data.value) }
</script>
<!-- valueA PATTERN -->
<Selectbind:value={valueA}></Select><br>
valueA={JSON.stringify(valueA)}<br>
<!-- valueB PATTERN -->
<Selectbind:value={valueB}></Select><br>
valueB={JSON.stringify(valueB)}<br>
When valueA is updated by the Select component, for some reason the update of data is detected.
This is a strange behavior because data is not actually updated at this time.
The code for valueB should be equivalent to the code for valueA.
However, if valueB is updated by the Select component, the update of data is not detected.
This is the expected behavior.
Describe the bug
https://github.com/sinbino/issue-sveltekit-reactive
See repository above
in src/routes/+page.svelte
When valueA is updated by the Select component, for some reason the update of data is detected.
This is a strange behavior because data is not actually updated at this time.
The code for valueB should be equivalent to the code for valueA.
However, if valueB is updated by the Select component, the update of data is not detected.
This is the expected behavior.
Why does this happen?
Reproduction
https://github.com/sinbino/issue-sveltekit-reactive
Logs
No response
System Info
Severity
annoyance
Additional Information
No response
The text was updated successfully, but these errors were encountered: