Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
initFoundation = () => {
const {dismissible, modal} = this.props;
if (this.foundation_) {
this.foundation_.destroy();
}
if (dismissible) {
this.foundation_ = new MDCDismissibleDrawerFoundation(this.adapter);
this.foundation_.init();
} else if (modal) {
this.initializeFocusTrap();
this.foundation_ = new MDCModalDrawerFoundation(this.adapter);
this.foundation_.init();
}
}
private initFoundation = () => {
const {dismissible, modal} = this.props;
if (this.foundation) {
this.foundation.destroy();
}
if (dismissible) {
this.foundation = new MDCDismissibleDrawerFoundation(this.adapter);
this.foundation.init();
} else if (modal) {
this.initializeFocusTrap();
this.foundation = new MDCModalDrawerFoundation(this.adapter);
this.foundation.init();
}
};