Explain it like I'm 5 - React Hooks
Andrew Nolan
2025-06-05
If you spend time around React code you will hear about Hooks. But what are these coding paradigms?
Short Answer
They are functions.
Long Answer
React Hooks are functions that let you "hook into" React internal features like state and lifecycle properties.
There are a few rules for React hooks:
- Hooks should only be called at the top level. Not inside loops or conditions.
- Only use hooks in React functions, not classes.
- All hooks start with the word "use"
That's it! They are just a special name for a certain set of functions in React.
You can build your own hooks. There are also several built-in hooks like:
- useState - Adds start to React components
- useEffect - Perform a side effect, like fetching data from an external source
- useContext - Access React Context
- useRef - Creates a variable that persists between rerenders
Now you know what a hook is in case anyone asks! Happy coding.
Enjoyed this article? Subscribe to the RSS Feed!