React isn’t reactive
Virtual DOM isn’t fast
Context API isn’t unsafe
UI library isn’t client side only
I thought React would be as reactive as its name, but it is not.
I was told that virtual DOM is fast and real DOM is slow, but wait, doesn’t virtual DOM operates over real DOM? It turns out it still does and thus why svelte takes a different approach. However, real DOM never allows you to write declarative UIs.
I thought memoization techniques like
useMemoetc are good performance tuning techniques to avoid over rendering. But I was not been told that, in fine grained reactivity system, manual optimizations don’t always have to exist in the first place. So it becomes a mixed feeling when watching React w/o memo.
Context API once famous for being an “experimental” API, causing whatever uses it considered experimental as well. However, almost all popular libraries in the community had been using it and they seem to be fine still. Might worth noting, even the "non-experimental" version comes with caveat as well.
The state management is a myth, and in someway it resembles a lot with the styling solutions in React ecosystem (css-in-js, css modules and plain css etc). I dabbled around with different solutions for a while only to realize that react-query is more practical for most apps I am working with.
Hooks are great in terms of composibility but somehow deceitful as well. One thing is that a granular control over how state and effects can be composed for reusability does not mean the same granularity on rendering efficiency. The other thing is, for anyone who has been using it for a while, stale closure would not be unfamiliar for them.
There are a lot of other aspects to mention, but the learning is still in progress...
After all, those are all just what we call trade-offs right?
Note: Inspired by https://learnvimscriptthehardway.stevelosh.com/