Question · Svelte and SvelteKit course · Module 3: Reactivity and Runes

Creating Reactive State

How do you create reactive state in Svelte 5?

Answer options

  • let count = reactive(0)
  • let count = $state(0)
  • const count = ref(0)
  • let count = useState(0)

You can check the correct answer by solving this task in the CodeWorlds game.