Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public componentDidMount() {
super.componentDidMount();
if (this.control) {
this.MDComponent = new MDCSwitch(this.control);
}
}
installed() {
this.switchControl = new MDCSwitch(this.shadowRoot.querySelector('.mdc-switch'))
this.switchFoundation = this.switchControl.getDefaultFoundation()
this.initSwitch()
}
onBeforeFlow() {
const switchElement = this.querySelector('.mdc-switch');
if (switchElement) {
this.mwcInstance = new MDCSwitch(switchElement);
}
}
}