In React.js, the useState hook is used to add state to functional components. It allows you to declare state variables in your functional components and provides a way to update them. This is a basic example of how to use the useState hook.
This is a simple example, and you can use the useState hook to manage more complex state in your functional components. Each call to useState creates a separate state variable, so you can use it multiple times in a single component.