React Hooks
The function useState
is a React Hooks!
As part of React 16.8, the Hooks were released to make it possible to use state, and other React features with function components.
We know useState
is a Hook because it's name starts with use
. All Hooks follow the same naming convention. If you want to create your own Hooks, you must follow the same convention.
We already explored useState
. The next section will overview the useEffect
Hook. These two functions are bar far the most commonly used Hooks. However, there are other Hooks built into React, and you can create your own Hooks too! Please consult the resources below.
- React Docs, Introducing Hooks.
- React Docs, Hooks API Reference.
- React Docs, Building Your Own Hooks.
- Snippets of Hooks.
- React Hooks Cheatsheet.