Bao Huynh @bhuynh.dev · Dec 3

My new noob discovery about @svelte.dev $derived: You might NOT need it! For simple expressions, put it straight into your markup. They're still reactive! $derived is nice to get a reactive **variable** for a complex expression and/or to be re-used many times. Other case, I prefer interpolation.

0 likes 1 replies

?

Replies

Bao Huynh · Dec 3

I feel silly only realizing this about Svelte today. Bonus discovery: expression interpolation is the only way to do this, whereas $derived can't