Eh, agree to disagree. I understand your point, but I think those points you mentioned are also changing.
Take lifecycle. It used to be very explicit. Then hooks turned it into this weird implicit thing where you have to know how use effect works and how to only trigger something once, but then the empty array thing is an anti pattern etc etc. Now with suspense, that lifecycle is changing again in a way. I’ve seen some tutorials where the teacher refactors out of use effect into throwing a promise. But then you can have use effects inside your thrown promise and dealing with module scope potentially.
It’s late and im a little out of it, but to me, this is all a lot of churn and creates long periods of uncertainty as developers try and decide which of these features they want to use and when.
At a certain point it can get really frustrating when it feels like you need to rewrite your app to stay up with “best practices” and attract new talent into your org. It would be one thing if the best practices were making things better functionally, but I find that argument hard to justify for anyone outside of Facebook scale. Angular and Vue stuck with a more traditional lifecycle ideology and there are plenty of apps building at scale on those frameworks. That stability in low level APIs gives a community time to grow and mature without leaving a bunch of people behind.
I honestly believe React would not be anywhere near the scale of what is today based on merit alone. They were lucky to see the demise of angular 1 and learn from that mistake and now Vue is sorta suffering the same way by moving too far away too quickly from 2 to 3.
> But then you can have use effects inside your thrown promise
That doesn’t sound right. The linter will certainly yell at you for doing that, and I’d be surprised if the program did not crash. The “rule of hooks” due to their implementation is that you can only call them from directly inside of a component function block, I.e. not from within an if block or a promise.
Developer choice is one of the things people cite as a reason not to use React already, since you have to pick a router, state management library, etc. What’s a couple more decisions about built-in features? =)
I will say that I feel the opposite way about hooks: I only became interested in using React after hooks were added, because classes in javascript always rubbed me the wrong way, and I want to get as close as possible to functional programming style from start to finish. We’re using it now, and reasoning about the app is much simpler than before. I can’t say how much is due to hooks specifically vs overall React app architecture, but the components are much more pleasing to my eyes!
I don't really agree with this. Sure, we went through createClass -> class -> functions + hooks, but the core is still props, state, and lifecycle.