Skip to content

Commit

Permalink
fix(modal): remove warning during state update. (#1448)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeushenecz authored Jul 7, 2021
1 parent a985f07 commit 273746a
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 273746a

Please sign in to comment.