DEV Community

Discussion on: How I moved from React to Svelte

 
webjose profile image
José Pablo Ramírez Vargas

For state management, use Svelte stores:

// stores/myCounter.js
import { writable } from 'svelte/store';

export myCounter = writeable(0);
Enter fullscreen mode Exit fullscreen mode

Then import anywhere you need the counter.

As for routing, there won't be an official CSR router. Only SvelteKit has routing. If you need routing, you'll find 2 or 3 options to choose from if you surf the WWW.