score:0

you haven't bound onsubmit method to the component instance in constructor. but you're expecting the context to be the component instance here:

const customer = {
   customername: this.state.customername,
   customercountry: this.state.customercountry
}

try adding:

this.onsubmit = this.onsubmit.bind(this);

Related Query

More Query from same tag