What is useState?
useState is a React Hook that allows functional components to create and manage state. Before Hooks were introduced, state could only be managed inside class components. With useState, developers can store values such as numbers, strings, booleans, arrays, and objects directly inside functional components and update them whenever needed.
Whenever the state changes, React automatically re-renders the component and updates the UI with the latest data.
Syntax
const [state, setState] = useState(initialValue);






