Your state looks like that:
{myObject: {
name: '',
email: ''
}}
but in inputHandler you dont update value in MyObject.name. You update (actually create) value in yorur first object. So result is:
{MyObject:{
name:'',
email:''
},
name:yorurInputValue
}
Try this:
useState({
name:'',
email:''
})
It sholuld work 🙂