What is useState() in React?

Full Stack Developer with a passion for building web applications. PHP, Node.js, Laravel, MySQL, MongoDB. Love collaborating & making a difference
useState is a React Hook that lets you track data or properties in your component.
const [state, setState] = useState(initialState)
You can initialize the state while declaring it and then setState in response to any event like
function handleClick() { setState(newState); }




