Skip to content
Permalink
Browse files

fix(react): ensure element exists in controller before dismissing it

  • Loading branch information...
mlynch committed May 26, 2019
1 parent f0af707 commit 0fd3e5d4c5fd376f3287fa8e9adbfbd24479481f
Showing with 1 addition and 1 deletion.
  1. +1 −1 react/src/components/createControllerComponent.tsx
@@ -49,7 +49,7 @@ export function createControllerComponent<T extends object, E extends OverlayCom

await this.element.present();
}
if (prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
if (this.element && prevProps.isOpen !== this.props.isOpen && this.props.isOpen === false) {
await this.element.dismiss();
}
}

0 comments on commit 0fd3e5d

Please sign in to comment.
You can’t perform that action at this time.