Skip to content
This repository was archived by the owner on Apr 9, 2019. It is now read-only.

Commit 05e752f

Browse files
author
Matt Hinz
committed
Fix TypeError in componentWillUnmount
this.__viewSpring does not exists, which was resulting in a TypeError.
1 parent 5cd2caf commit 05e752f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/navigation-controller.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ class NavigationController extends React.Component {
112112
});
113113
}
114114

115+
componentWillUnmount() {
116+
delete this.__springSystem;
117+
this.__spring.removeAllListeners();
118+
delete this.__spring;
119+
}
120+
115121
componentDidMount() {
116122
// Cache the view wrappers
117123
this['__view-wrapper-0'] = React.findDOMNode(this.refs[`view-wrapper-0`]);
@@ -124,10 +130,6 @@ class NavigationController extends React.Component {
124130
});
125131
}
126132

127-
componentWillUnmount() {
128-
this.__viewSpring.destroy();
129-
}
130-
131133
/**
132134
* Translate the view wrappers by a specified percentage
133135
*

0 commit comments

Comments
 (0)