3 ms·
> You can't create abstractions where a hook calls another hook. Not sure if I understand you correctly, but isn't this the purpose of custom hooks? You should
by bcyn 7y ago
> You can't create abstractions where a hook calls another hook.
Not sure if I understand you correctly, but isn't this the purpose of custom hooks? You should be able to freely call hooks within other hooks.
- Normal_gaussian 7y agoYou absolutely can create abstractions where a hook calls another hook. It is perhaps the single most useful change hooks have given me. Of course you need to follow the same rules in the hook (always call every hook it calls, in the same order, so you don't mess up the order above).
- bcheung 7y agoNot inside of useEffect.
- Normal_gaussian 7y agoYes, you're right with that. Its curious that I haven't found that to be a pain point.