Skip to content

Instantly share code, notes, and snippets.

@Siemko
Created January 28, 2018 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Siemko/3917a9007b09433af144beb2d4e3c78d to your computer and use it in GitHub Desktop.
Save Siemko/3917a9007b09433af144beb2d4e3c78d to your computer and use it in GitHub Desktop.
FormSample React.js component
import React, { Component } from "react";
export default class FormSample extends Component {
state = {
employer: "Gorrion"
};
handleEmployerChange = e => {
this.setState({ employer: e.target.value });
};
render() {
return (
<div className="field">
<label className="label">Employer</label>
<div className="control">
<input
className="input"
type="text"
onChange={this.handleEmployerChange}
value={this.state.employer}
/>
</div>
</div>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment