Skip to content

Instantly share code, notes, and snippets.

View itsamirkhan's full-sized avatar
🏠
Working from home

Amir Khan itsamirkhan

🏠
Working from home
View GitHub Profile
@whoisryosuke
whoisryosuke / api-form-submit.js
Created October 3, 2018 17:14
React - Handling forms and submitting POST data to API -- @see: https://reactjs.org/docs/forms.html
class NameForm extends React.Component {
constructor(props) {
super(props);
this.state = { name: '' };
}
handleChange = (event) => {
this.setState({[event.target.name]: event.target.value});
}