Answer the question
In order to leave comments, you need to log in
Why can't hooks be used in conditions?
there is a hook rule where there is a condition that you can't use hooks under conditions, who knows why? what will break there if we use them in conditions and why is it important for react to remember the sequence of hooks
Answer the question
In order to leave comments, you need to log in
Because the internal implementation of hooks is tied to the call queue. That's how it's done. To better understand exactly how, I advise you to look at the talk in which Michael Jackson (not the same one) writes his own implementation of hooks. Here's the link
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question