Use reactive declarations to compute component state in Svelte 3

Tomasz Łakomy
InstructorTomasz Łakomy

Share this video with your friends

Send Tweet

Svelte automatically updates the DOM when your component's state changes. Often, some parts of a component's state need to be computed from other parts. This is where reactive declarations come in.

In this lesson we are going to learn how to use reactive declarations to re-compute (and render) square of a counter value in a simple counter example whenever user clicks on a button.

Hakan Karaduman
Hakan Karaduman
~ 2 years ago

Hi Tomasz,

Those are very informative lessons, thank you for your effort.

I'm confused on how $: is regular javascript, can you explain it more please?