Reputation: 71
I'm trying to separate logic in my app and I was wondering If is it possible to call a custom hook inside another custom hook
Upvotes: 7
Views: 13346
Reputation: 447
You can call a custom hook inside another custom one. I offer to read this article to use it right away. Link: https://reactjs.org/warnings/invalid-hook-call-warning.html#breaking-the-rules-of-hooks
Upvotes: 1
Reputation: 99525
Yes. Just follow the main rules of hooks. Don't call them conditionally, etc.
Upvotes: 3