Created
May 17, 2018 07:48
-
-
Save jokamjohn/b29386e5ccbc9ae57b9b42d9018fdda9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
onSubmit = event => { | |
event.preventDefault(); | |
const name = this.name.value; | |
const age = this.age.value; | |
const info = {name: name, age: age}; | |
const data = this.state.data; | |
data.push(info); | |
this.setState({ | |
data: data | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment