onChange
In React, onChange is used to handle user input in real-time. If you want to build a form in React, you need to use this event to track the value of input elements. Now whenever you type something into the input box, React will trigger the function that we passed into the onChange prop.
useState
useState is used to declare variables inside a function. The value of useState() consist of an array with two values
[intial value, reference after update]
//state in event handler
var[like, setLike] = useState(0);
//like = intial , setLike = store the value after the update
function likeUpdate(){
var newLike = like+1;
setLike(newLike)
}