💡 I discovered an interesting quirk in #Svelte 5 when using the $state rune to store an object.

Simple objects are reactive, but class instances are not.

So how do you get class instance properties to be reactive?

Here's my solution 👇

https://chasingcode.dev/blog/svelte-5-state-rune-class-vs-object-reactivity/

Svelte 5 $state rune Class vs Object reactivity

Exploring how storing a Class object vs a regular Object in a Svelte 5 $state rune differs

@brbcoding if I recall Rich talked about this somewhere along the way and I believe his take was to make each property a $state object itself, possibly $derived? I'm on my phone so I haven't tested any code though

@jkibble yeah I think that might be an option too. The dev who helped me initially hinted to it. Unfortunately I've had to figure this stuff out on my own because the docs aren't very helpful in this respect.

I'll experiment and update the post if I find another way.