Skip to content

Instantly share code, notes, and snippets.

@nodox nodox/Buttons.js
Last active Jul 1, 2018

Embed
What would you like to do?
Building a stepper - buttons.js
import React from "react";
class Next extends React.Component {
render() {
const { isActive } = this.props;
if (isActive === false) return null;
return (
<button onClick={() => this.props.goToNextStep()}>
Next
</button>
);
}
}
class Previous extends React.Component {
render() {
const { isActive } = this.props;
if (isActive === false) return null;
return (
<button onClick={() => this.props.goToPreviousStep()}>
Previous
</button>
);
}
}
class Submit extends React.Component {
render() {
const { isActive } = this.props;
if (isActive === false) return null;
return (
<button type="submit">
Submit
</button>
);
}
}
export { Previous, Next, Submit };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.