DEV Community

Discussion on: React Just Got Even More Awesome

Collapse
 
marek profile image
Marek Zaluski • Edited

It's an interesting addition to hook functionality, but the thing that stands out to me is the fact that this is a hook that is allowed to be called conditionally.

Hooks are normally known for not being intended to be called conditionally. The use hook introduces an exception.

Now, the RFC talks about this, and it makes a point that this is fine, because it's only going to be the one single exception, and that rather than having to remember a bunch of arbitrary exceptions, we just need to remember this single one.

I think that this nevertheless still introduces a confusing piece of knowledge that you have to remember about hooks and about the special behavior of this proposed hook.

As we pile on more and more of this kind of complexity on top of hooks, and more magical behavior, it makes me wonder: are hooks the wrong direction? Were they a mistake for React?

Collapse
 
danielpklimuntowski profile image
Daniel Klimuntowski

I really enjoyed your verbose and well-styled comment 😌