There are several built-in hooks, but two fundamental ones are useState
and useEffect
.
-
useState:
useState
is used to add state to functional components.- It returns an array with two elements: the current state value and a function that lets you update it.
- Here's a simple example: