3 ms·
I recently switched to using React and Next.js for a number of front-end projects, almost solely because of its wide developer adoption (making it easier to hir
by aosaigh 4y ago
I recently switched to using React and Next.js for a number of front-end projects, almost solely because of its wide developer adoption (making it easier to hire developers).
Outside of that network effect, I'm completely and utterly baffled by React's popularity. It's the most counterintuitive framework I've ever used. Things like the `useEffect` dependency arrays and the general naming of hooks seems to lack any thought. That said, Next.js and Vercel are excellent and probably responsible for Gatsby's precipitous fall.
Unfortunately I felt that Vue's switch to the composition API was poorly handled and have found myself frustrated trying to figure out how to migrate to it, so I'm not hugely surprised by its descent.
I'm interested in trying Svelte but wary of investing time in yet another framework, having been through Angular, Ember, React, Vue and all of the tooling that goes with each of them.
- logicalmonster 4y ago> Outside of that network effect, I'm completely and utterly baffled by React's popularity. It's the most counterintuitive framework I've ever used. Things like the `useEffect` dependency arrays and the general naming of hooks seems to lack any thought. This is why it was so disheartening to me to see Qwik try and emulate React in many respects: one of more interesting framework and performance concepts in a while, and they had to go and make it look and feel React-like. Blah. For what it's worth, I have not tried all JS frameworks, but I think Svelte and Mithril have the best developer experiences of those I've tried.
- schwartzworld 4y ago> Things like the `useEffect` dependency arrays and the general naming of hooks seems to lack any thought. In React, everything rerenders newly in response to state changes. All functions are called on each render. Side effects need to be limited so that they aren't called on every render. The dependency array is where you say "only perform the side effect in response to changes to these specific values". The problem is that most people aren't used to React's functionalish programming model. It's really common to have way too much state in a React app, and then rely on useEffect to manage that state. If your useEffect isn't reaching outside your React app in some way, it probably represents a flaw in the way you've structured everything.
- aosaigh 4y agoI understand this now, but it took an awful lot of effort to just understand why things are designed like this. I don't think React does a good enough job describing its worldview and why things are they way they are. I actually think that this is another place where its popularity gets in the way: there are so many low quality blog posts clogging up the search results, making it difficult to find any wisdom on the subject.
- schwartzworld 4y agoCheck out the "beta" docs which are far superior https://beta.reactjs.org/learn/synchronizing-with-effects https://beta.reactjs.org/learn/synchronizing-with-effects
- uglycoyote 4y agoI find if you avoid the use of any function that has the word use in it, react is a lot more useful and usable.