Skip to content

Commit

Permalink
fix(view.js): fix crash on style.delete() when interactive prop is …
Browse files Browse the repository at this point in the history
…set to `false`

When `interactive` prop is set to `false`, `this.style` remains null, but component's
`componentWillUnmount` method still tries to delete and crash.
  • Loading branch information
v-kiniv committed May 26, 2024
1 parent 5ff3d53 commit 0c0722f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/View.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,10 +427,12 @@ export default class View extends Component {
this.interactor.setInteractorStyle(null);
}

this.style.delete();
if (this.style) {
this.style.delete();
this.style = null;
}
this.defaultStyle.delete();
this.defaultStyle = null;
this.style = null;
this.renderer = null;
this.selector = null;
this.orientationWidget = null;
Expand Down

0 comments on commit 0c0722f

Please sign in to comment.