Skip to content

Instantly share code, notes, and snippets.

@geetotes
Last active April 30, 2017 23:15
Show Gist options
  • Save geetotes/8745ef0a5410d74f8525a41e557a4d1a to your computer and use it in GitHub Desktop.
Save geetotes/8745ef0a5410d74f8525a41e557a4d1a to your computer and use it in GitHub Desktop.
class Step1 extends React.Component {
constructor(props) {
super(props);
// Bindings for form fields would go here,
// and state would keep track of field input
}
_validate() {
// a sanitized version of state can be passed instead
this.props.afterValid(this.state)
}
render() {
if (this.props.currentStep !== 1) {
return null;
}
return(
<form>
// Form fields would go here
<button onClick={this._validate} />
</form>
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment