Creating & Using Custom React Hooks
- Repetition: Rules of Hooks
- Why Custom Hooks?
- Creating Custom Hooks
- Using Custom Hooks
Rules of Hooks
- Only call Hooks inside of Component or Other Hook Functions
- React Hooks must not be called outside of React component functions or other Hook functions
- Only call Hooks on the top level
- React Hooks must not be called in nested code statements (e.g., inside of if-statements)
Resources