4 ms·
Classes look familiar, but that's misleading because they don't actually work like one would expect. Hooks are actually much closer to what react does internal
by TsiCClawOfLight 6y ago
Classes look familiar, but that's misleading because they don't actually work like one would expect.
Hooks are actually much closer to what react does internally, and therefore behave much less surprisingly once you get into advanced things.
Think of hooks like a missing primitive (similar to functions, classes and closures) that are critical to the react language, but don't actually exist in JavaScript and thus have to be approximated.
- moring 6y ago> Classes look familiar, but that's misleading because they don't actually work like one would expect. Can you give an example for that? So far, they worked pretty much as I expected. (Coming from a mostly Java background, which is relevant for what I expect).