Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,13 @@ export class ComponentProvider extends React.Component<IComponentProviderProps,
};

public async componentDidMount(): Promise<void> {
const component = await this.loadComponent();

this.setState({
Component: component,
hasError: false,
});
this.updateStateOnLoad();
}

public async componentDidUpdate(prevProps: IComponentProviderProps): Promise<void> {
const { config } = prevProps;

if (this.shouldReload(config)) {
const component = await this.loadComponent();

this.setState({
Component: component,
hasError: false,
});
this.updateStateOnLoad();
}
}

Expand Down Expand Up @@ -166,4 +155,13 @@ export class ComponentProvider extends React.Component<IComponentProviderProps,

return true;
}

private async updateStateOnLoad(): Promise<void> {
const component = await this.loadComponent();

this.setState({
Component: component,
hasError: false,
});
}
}