Skip to content

Commit

Permalink
componentDidUpdate to reset renderError
Browse files Browse the repository at this point in the history
  • Loading branch information
himdel committed May 25, 2024
1 parent e4a6176 commit 1cf6f2f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/render-plugin-doc.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ export class RenderPluginDoc extends Component<IProps, IState> {
this.setState({ renderError: true });
}

componentDidUpdate(prevProps) {
if (this.state.renderError && this.props.plugin !== prevProps.plugin) {
this.setState({ renderError: false });
}
}

render() {
const { plugin } = this.props;

Expand Down

0 comments on commit 1cf6f2f

Please sign in to comment.