Skip to content

Comment on Svelte 5 release candidate (RC)

Comments

In Svelte 3 and 4, components are classes. In Svelte 5 they are functions and should be instantiated differently.

This is classic React!

Not 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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.