|
|
|
|
|
by benmccann
1686 days ago
|
|
But React isn't just JSX. It's also the entire runtime library, hooks, event handling, forms, state handling, etc. The example you shared is a bit too simple to understand where Svelte shines because it doesn't introduce any of those concerns. By having it's own templating language, Svelte is able to compile the templates to JavaScript in a way that addresses many of those concerns in a way that I think it easier to deal with as an end user of the framework. If Svelte were using JSX, I don't know that it'd be possible to do everything else that it does so simply because you can write anything that's valid JavaScript in JSX whereas Svelte has just a couple of basic control structures that its compiler can parse and convert to runnable code. |
|
When property changes, the fetch refires, loading appears until the fetch resolves then it displays whatever array someFetch resolved to.
I came from Vue and that plus the way Svelte does stores (literally nothing special about them) was a breath of fresh air.