Understanding React Hooks
- 1. Introducing Hooks
- 2. Hooks at a Glance
- 3. Using the State Hook
- 4. Using the Effect Hook
- 5. Rules of Hooks
- 6. Building Your Own Hooks
- 7. Hooks API Reference
- 8. Hooks FAQ
What is a Hook?
Hooks are functions that let you "hook into" React state and lifecycle features from function components. Hooks don't work inside classes - they let you use React without classes.
React provides a few built-in Hooks likeuseState. You can also create your own Hooks to reuse stateful behavior between different components.