Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
this.subscription = themeListener.subscribe(this.context, this.setTheme);
}
componentWillUnmount() {
componentDidMount() {
if (this.state.theme) {
this.subscriptionId = themeListener.subscribe(this.context, this.setTheme)
}
}