Created
May 17, 2018 07:49
-
-
Save jokamjohn/6a227aaa08a7f40ba2e9dc2022d89766 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, info]; | |
this.setState({ | |
data: data | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment