Last active
September 29, 2018 18:59
-
-
Save dance2die/602254e2f6389e2a9f06f6c7d4185334 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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