Closed
Description
Describe the bug
I was just reading about "Using context with state" on https://svelte.dev/docs/svelte/context#Using-context-with-state and I tried out the linked demo ... but it didn't work! Clicking increment does not update the counter in the Child component. What am I missing? As far I can tell, everything done in the demo looks correct and "should" work.
So as far I can tell, this is a Svelte bug, yes?
And if it's not a Svelte bug, then it would be very instructional to find out what is wrong with this usage.
Interestingly, adding $inspect(counter)
to Child.svelte is enough to trick it into working. But that's obviously not the proper solution.
Reproduction
See demo linked to from https://svelte.dev/docs/svelte/context#Using-context-with-state
Logs
System Info
N/A
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels