5 ms·
> In Svelte 3 and 4, components are classes. In Svelte 5 they are functions and should be instantiated differently. This is classic React!
by move-on-by 2y ago
> In Svelte 3 and 4, components are classes. In Svelte 5 they are functions and should be instantiated differently.
This is classic React!
- tacone 2y agoNot exactly, in Svelte you don't declare components in plain js, you create a svelte file and the compiler does the rest. Whether a component is a function or a class is an internal detail you don't need to know, except in the case you are instantiating a component manually, which is a edge case.