1afterSubmission(event) {
2 event.preventDefault();
3 let name = this.state.itemName;
4 this.setState ({
5 storedItemName:this.state.itemName
6 }, function() {
7 alert(this.state.storedItemName); // Shows the right value!
8 }
9}
10