Skip to content

Instantly share code, notes, and snippets.

@tarang9211
Last active September 23, 2018 12:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tarang9211/401095d798a1fe5fb0a95b5b2da1f564 to your computer and use it in GitHub Desktop.
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