Skip to content

Instantly share code, notes, and snippets.

@tarang9211
Last active September 23, 2018 12:58
Show Gist options
  • Save tarang9211/401095d798a1fe5fb0a95b5b2da1f564 to your computer and use it in GitHub Desktop.
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