Skip to content

Commit 0c0722f

Browse files
committed
fix(view.js): fix crash on style.delete() when interactive prop is 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.
1 parent 5ff3d53 commit 0c0722f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/core/View.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,12 @@ export default class View extends Component {
427427
this.interactor.setInteractorStyle(null);
428428
}
429429

430-
this.style.delete();
430+
if (this.style) {
431+
this.style.delete();
432+
this.style = null;
433+
}
431434
this.defaultStyle.delete();
432435
this.defaultStyle = null;
433-
this.style = null;
434436
this.renderer = null;
435437
this.selector = null;
436438
this.orientationWidget = null;

0 commit comments

Comments
 (0)