Remove unused animated subscribe code
This commit is contained in:
parent
9d0ec3f7ae
commit
6e95ceea1f
|
@ -76,15 +76,6 @@ const GESTURE_RESPONSE_DISTANCE_VERTICAL = 135;
|
||||||
|
|
||||||
const USE_NATIVE_DRIVER = true;
|
const USE_NATIVE_DRIVER = true;
|
||||||
|
|
||||||
const animatedSubscribeValue = animatedValue => {
|
|
||||||
if (!animatedValue.__isNative) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (Object.keys(animatedValue._listeners).length === 0) {
|
|
||||||
animatedValue.addListener(emptyFunction);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const getDefaultHeaderHeight = isLandscape => {
|
const getDefaultHeaderHeight = isLandscape => {
|
||||||
if (Platform.OS === 'ios') {
|
if (Platform.OS === 'ios') {
|
||||||
if (isLandscape && !Platform.isPad) {
|
if (isLandscape && !Platform.isPad) {
|
||||||
|
@ -187,19 +178,6 @@ class StackViewLayout extends React.Component {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
_animatedSubscribe(props) {
|
|
||||||
// Hack to make this work with native driven animations. We add a single listener
|
|
||||||
// so the JS value of the following animated values gets updated. We rely on
|
|
||||||
// some Animated private APIs and not doing so would require using a bunch of
|
|
||||||
// value listeners but we'd have to remove them to not leak and I'm not sure
|
|
||||||
// when we'd do that with the current structure we have. `stopAnimation` callback
|
|
||||||
// is also broken with native animated values that have no listeners so if we
|
|
||||||
// want to remove this we have to fix this too.
|
|
||||||
animatedSubscribeValue(props.transitionProps.layout.width);
|
|
||||||
animatedSubscribeValue(props.transitionProps.layout.height);
|
|
||||||
animatedSubscribeValue(props.transitionProps.position);
|
|
||||||
}
|
|
||||||
|
|
||||||
_reset(resetToIndex, duration) {
|
_reset(resetToIndex, duration) {
|
||||||
if (Platform.OS === 'ios' && supportsImprovedSpringAnimation()) {
|
if (Platform.OS === 'ios' && supportsImprovedSpringAnimation()) {
|
||||||
Animated.spring(this.props.transitionProps.position, {
|
Animated.spring(this.props.transitionProps.position, {
|
||||||
|
|
Loading…
Reference in New Issue