4 ms·
React has a lot of opinionated, "magical" boilerplate. useThis, useThat, ... In my experience, Svelte did a much better job and is closer to vanilla html/js, bu
by vekker 3y ago
React has a lot of opinionated, "magical" boilerplate. useThis, useThat, ... In my experience, Svelte did a much better job and is closer to vanilla html/js, but for some reason it seems to fail to gain significant traction.
- kehrin 3y ago> In my experience, Svelte did a much better job and is closer to vanilla html/js I just looked at some Svelte examples and it's a mix of magic keywords (on, bind) with magic symbols (: | @) and new, completely unrelated syntax to both JS and HTML (#each, #if, :else). I guess it looks way more idiomatic if you have an IDE that highlights and lints it correctly. React with its few rules of hooks seems way closer to vanilla JS.
- iainmerrick 3y agoI agree -- I don't love Svelte but it feels much closer to just writing plain HTML+JS+CSS than any other fancy JS framework I've tried. The goals of this project and Svelte seem very similar, so I'd be interested to see a more in-depth comparison.
- gcau 3y agoHooks are just normal javascript functions though, they're not syntax.
- iainmerrick 3y agoNo special syntax but they do have special semantics, as per the "rules of hooks".
- root_axis 3y ago"use" is just a convention for hook function names, react doesn't require or enforce it.
- iainmerrick 3y agoIt's "just" a convention, but a strongly encouraged one. The React docs say: Its name should always start with `use` so that you can tell at a glance that the rules of Hooks apply to it. And it is required and enforced if you use the ESLint react-hooks plugin (which I'm guessing most large projects do).
- mike31fr 3y agohttps://stackoverflow.com/questions/66151248/do-react-hooks-really-have-to-start-with-use https://stackoverflow.com/questions/66151248/do-react-hooks-...