Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Svelte Tutorial Universal State updating without $state #1229

Closed
tertiusunaffi opened this issue Mar 25, 2025 · 7 comments · Fixed by #1273
Closed

Svelte Tutorial Universal State updating without $state #1229

tertiusunaffi opened this issue Mar 25, 2025 · 7 comments · Fixed by #1273

Comments

@tertiusunaffi
Copy link

https://svelte.dev/tutorial/svelte/universal-reactivity

In universal section, it says "But it’s a normal object, and as such nothing happens when you click the buttons.".
However, the buttons does, in fact, change when I click on them…

@u-m-i
Copy link

u-m-i commented Mar 25, 2025

Jajajaja I was about to just literally post the same issue!

@u-m-i
Copy link

u-m-i commented Mar 25, 2025

Here some proof:

Image

@hanszoons
Copy link

The component is in legacy mode, so it works because it operates like in svelte 3/4.
If you enable runes by adding <svelte:options runes={true} /> to the component, it does require the suggested solution.

Very confusing, had the same issues in some REPLs too, because it defaults to legacy mode when no svelte 5 features are detected or not explicitly set to runes mode.

@u-m-i
Copy link

u-m-i commented Mar 27, 2025

@hanszoons Your reply could be a side note in the tutorial.

@Conduitry Conduitry marked this as a duplicate of #1233 Mar 28, 2025
@brunnerh brunnerh marked this as a duplicate of #1237 Mar 30, 2025
@graphnode
Copy link

Perhaps runes mode should be set by default on the tutorial? At least to not confuse beginners.

The playground has a indicator telling you if it's in runes mode.

@brunnerh brunnerh marked this as a duplicate of #1265 Apr 6, 2025
@brunnerh brunnerh marked this as a duplicate of #1234 Apr 7, 2025
@DepkaCZ
Copy link

DepkaCZ commented Apr 7, 2025

Yeah stumbled upon this today as well.

@Islam0s
Copy link

Islam0s commented Apr 8, 2025

yeah they need to solve this i spend 3 days trying to understand what is the problem.

@Rich-Harris Rich-Harris linked a pull request Apr 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants