React is becoming a black box
It pains me to say it, but React on the verge of becoming a black box. On any given day, just search “React hooks” on Twitter and you’ll inevitably stumble upon a conversation that goes something like this:
Not many folks are talking about it publicly, perhaps for fear of embarrassment or exposing their lack of knowledge, but recent Twitter banter over the last few months as well as conversations I’ve had with a handful of “thought leaders” have made it clear that very very few people in the community understand how React works now. I hope I am wrong, but I am very concerned that forthcoming Concurrent Mode is going to make React even more difficult to reason about.
Remember that React is supposed to take care of the “how” so that we can focus on the “what” of our apps. This mantra though, assumes that we can predict the “how”-part correctly. I’m worried that the causality of the framework (i.e. the voice inside your head that says “if this, then that” when you’re coding) is becoming opaque to even power users, let alone beginners. I wish I had more feedback or even a suggested solution about how to fix this, but I haven’t figured it out yet. Thus, my only suggestion would be to perhaps take extra care when the React team releases Concurrent Mode (and/or whatever comes next) to re-teach people about how to reason about React. I think a good ol’ Pete Hunt-style “Thinking in X mode” blog post would go a long way. Anyways, that’s it for my hot take. What do you think?