React Hooks – Create Custom Hooks
- What are the rules of creating Hooks?
- Why use custom hooks?
- Creating Custom Hook Example 1
What are the rules of creating Hooks?
that’s what allows React to correctly preserve the state of Hooks between multiple
https://reactjs.org/docs/hooks-rules.htmluseState
anduseEffect
calls.
Rule: Don’t call Hooks inside loops, conditions, or nested functions
Rule: Only Call Hooks from React Functions