score:1

Accepted answer

try something like this in your child component instead of console.log(props). props does not change because you did not change default state. if you try to log actual state, it is changing.

const [state, setstate] = usestate({
    projectname: "",
    description: ""
  });
console.log(state);

score:0

this question has already been answered in a different question. the thing is setstate function is asynchronous. to overcome this you can use callback functions to print the state after it is updated. the link to the original answer is below state not updating when printing on same function where updating in react js


Related Query

More Query from same tag