Skip to content

Instantly share code, notes, and snippets.

@dance2die
Last active September 29, 2018 18:59
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 dance2die/602254e2f6389e2a9f06f6c7d4185334 to your computer and use it in GitHub Desktop.
Save dance2die/602254e2f6389e2a9f06f6c7d4185334 to your computer and use it in GitHub Desktop.
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