Skip to content

Instantly share code, notes, and snippets.

@dance2die dance2die/Wizard.js
Last active Sep 29, 2018

Embed
What would you like to do?
class Wizard extends Component {
errorBoundary = React.createRef();
// redacted unrelevant code...
onStepClick = current => {
this.errorBoundary.current.state.error = null;
};
render() {
const { current } = this.state;
return (
<div>
<Steps current={current}>
{steps.map((item, step) => (
<Steps.Step
key={item.title}
onClick={e => this.onStepClick(step)}
/>
))}
</Steps>
<div className="steps-content">
<ErrorBoundary
ref={this.errorBoundary}
FallbackComponent={ErrorFallbackComponent}
>
{this.getContent()}
</ErrorBoundary>
</div>
</div>
);
}
}
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.