From 6a0c6de32912e1efc19f90b679b1b3b9ac48f97e Mon Sep 17 00:00:00 2001 From: Brent Vatne Date: Fri, 24 Aug 2018 10:06:37 -0700 Subject: [PATCH] Filter out active prop on dummy screen component --- .../NestedNavigator-test.js.snap | 2 -- .../__snapshots__/StackNavigator-test.js.snap | 2 -- src/views/StackView/StackViewCard.js | 25 +++++++------------ src/views/StackView/screens.js | 15 ++++++++++- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/navigators/__tests__/__snapshots__/NestedNavigator-test.js.snap b/src/navigators/__tests__/__snapshots__/NestedNavigator-test.js.snap index 9f950b6..1a93372 100644 --- a/src/navigators/__tests__/__snapshots__/NestedNavigator-test.js.snap +++ b/src/navigators/__tests__/__snapshots__/NestedNavigator-test.js.snap @@ -44,7 +44,6 @@ exports[`Nested navigators renders succesfully as direct child 1`] = ` = 0.56, then we have - // to call position.__makeNative(). Unclear to me what is happening here - // so temporarily commented this out. - // - // const active = position.interpolate({ - // inputRange: [index, index + 1 - EPS, index + 1], - // outputRange: [1, 1, 0], - // extrapolate: 'clamp', - // }); + const active = position.interpolate({ + inputRange: [index, index + 1 - EPS, index + 1], + outputRange: [1, 1, 0], + extrapolate: 'clamp', + }); return ( {children} diff --git a/src/views/StackView/screens.js b/src/views/StackView/screens.js index fce1d3f..914f215 100644 --- a/src/views/StackView/screens.js +++ b/src/views/StackView/screens.js @@ -1,6 +1,19 @@ +import React from 'react'; import { Animated, View } from 'react-native'; const ScreenContainer = View; -const Screen = Animated.View; + +class Screen extends React.Component { + render() { + // Filter out active prop in this case because it is unused and + // can cause problems depending on react-native version: + // https://github.com/react-navigation/react-navigation/issues/4886 + + /* eslint-disable no-unused-vars */ + const { active, onComponentRef, ...props } = this.props; + + return ; + } +} export { ScreenContainer, Screen };