Skip to content

Commit

Permalink
fix(react): Don't render overlay children if isOpen is false, fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
elylucas committed Jan 17, 2020
1 parent 22f9229 commit aff9612
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/components/createOverlayComponent.tsx
Expand Up @@ -40,7 +40,7 @@ export const createOverlayComponent = <OverlayComponent extends object, OverlayT
}

componentDidMount() {
if (this.props.isOpen as boolean) {
if (this.props.isOpen) {
this.present();
}
}
Expand Down Expand Up @@ -92,7 +92,7 @@ export const createOverlayComponent = <OverlayComponent extends object, OverlayT

render() {
return ReactDOM.createPortal(
this.props.children,
this.props.isOpen ? this.props.children : null,
this.el
);
}
Expand Down

0 comments on commit aff9612

Please sign in to comment.