An open API service indexing awesome lists of open source software.

https://github.com/selmasaltik/react-custom-hooks

Building Custom React Hooks /// What I learned from "React - The Complete Guide 2024 (incl. Next.js, Redux) - Academind by Maximilian Schwarzmüller"
https://github.com/selmasaltik/react-custom-hooks

react react-custom-hooks react-hooks

Last synced: 3 months ago
JSON representation

Building Custom React Hooks /// What I learned from "React - The Complete Guide 2024 (incl. Next.js, Redux) - Academind by Maximilian Schwarzmüller"

Awesome Lists containing this project

README

        

# Custom Hooks
***Creating & Using Custom React Hooks***

- Repetition: **Rules of Hooks**
- **Why** Custom Hooks?
- **Creating** Custom Hooks
- **Using** Custom Hooks

**Rules of Hooks**

1. **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
2. **Only call Hooks *on the top level***
- React Hooks must not be called in nested code statements (e.g., inside of if-statements)

***Resources***
- [Building Your Own Hooks](https://legacy.reactjs.org/docs/hooks-custom.html)
- [Reusing Logic with Custom Hooks](https://react.dev/learn/reusing-logic-with-custom-hooks)