While I like Svelte, I fear it looses some of the flexible API-building enabled by React.<p>Specifically: since it uses a templating system, you can't pass around interface definitions easily:<p>- <a href="https://github.com/sveltejs/svelte/issues/3480" rel="nofollow">https://github.com/sveltejs/svelte/issues/3480</a> (no dynamic slots)<p>- <a href="https://github.com/sveltejs/svelte/issues/5381" rel="nofollow">https://github.com/sveltejs/svelte/issues/5381</a> (can't wrap children)<p>You can always find workarounds for these cases, often using `<svelte:component>`, but React's Javascript/Typescript-centric design avoids such issues before they even occur. For instance, I can trivially define a tabbed interface by mixing strings, JSX, and components, without imposing any DOM-structure. The component that reads this definition can use it to build a tabbed-view on mobile, and a master-detail-view on desktop. It could even build a table of contents.<p>In the definition, I can still work mostly with strings, but fall back to JSX in the rare case where I do need some advanced formatting:<p><pre><code> const tabs = [
{ name: "Tab 1", icon: <img ... />, content: MainTab },
{ name: <>Tab with <b>bold<b/> text</>, icon: <MyIconComponent ... />, content: SecondTab },
]
</code></pre>
Again, I like Svelte, but I'm not yet sure whether the better syntax is worth the reduced expressivity.