4 ms·
The 'Mustaches' bit killed it for me, but up until then I was enjoying the simplicity of the API. I like React (and React-like implementations) because of being
by spraak 10y ago
The 'Mustaches' bit killed it for me, but up until then I was enjoying the simplicity of the API. I like React (and React-like implementations) because of being able to use JS to build up a view
- ricardobeat 10y agoReact also uses curly braces for interpolation, not that different.
- ryanbrunner 10y agoI would imagine that he meant the control-structure stuff like {#if}, rather than pure JS.
- ricardobeat 10y agoYeah I interpreted his comment to be about syntax. OTOH React (JSX) lacks these control structures inline in the templates, it has to be done in separate steps, not a clear win for all situations.
- hesarenu 10y agoYep. For me React JSX simplifies component building.
- boubiyeah 10y agoYeah, same. Can't give up JS/TS templating and typesafety. simply for a smaller size, I already use something that is way, way smaller than react.
- rich_harris 10y agoWe should do a better job of clarifying: this isn't Mustache-the-language, it's just using {{ and }} as delimiters. The syntax is simpler than Mustache, and allows you to use any inline JavaScript expression, which will become fully reactive.
- spraak 10y agoEr, can you explain further with an example? I'm confused about using both something like {{#if}} and pure JS
- rich_harris 10y agoSee e.g. http://bit.ly/2fRcyJq http://bit.ly/2fRcyJq. The {{#if ...}} part is a control flow directive that allows Svelte to understand the structure of your app, but the condition of that if block is just a JS expression
- spraak 10y agoBut it's limited to if, else, and elseif expressions?