Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Warning during state update. #1448

Merged
merged 8 commits into from
Jul 7, 2021
8 changes: 4 additions & 4 deletions src/components/ui/modal/modal.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ export class Modal extends React.PureComponent<ModalProps, State> {
if (this.modalId && !this.props.visible) {
this.hide();
}

if (this.modalId && this.props.visible) {
ModalService.update(this.modalId, this.renderContentElement());
}
}

public componentWillUnmount(): void {
Expand Down Expand Up @@ -158,10 +162,6 @@ export class Modal extends React.PureComponent<ModalProps, State> {
};

public render(): React.ReactNode {
if (this.modalId && this.props.visible) {
ModalService.update(this.modalId, this.renderContentElement());
}

return null;
}
}
Expand Down