Last active
September 23, 2018 12:58
-
-
Save tarang9211/401095d798a1fe5fb0a95b5b2da1f564 to your computer and use it in GitHub Desktop.
This file contains 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
import React, { Component } from 'react'; | |
class App extends Component { | |
state = { | |
inputs: [], | |
showState: false | |
}; | |
handleSubmit = (event) => { | |
event.preventDefault(); | |
this.setState(prevState => ({ | |
showState: true | |
})); | |
} | |
render() { | |
return ( | |
<div className='App'> | |
<form onSubmit={this.handleSubmit}> | |
<button type='submit'>Submit</button> | |
</form> | |
</div> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment