From c3000e11e55991c96ae2cd81848dbf6824ac574d Mon Sep 17 00:00:00 2001 From: Hafees Olatunji Date: Mon, 6 Apr 2020 14:48:17 +0100 Subject: [PATCH 1/2] Replaced Animated.Text.propTypes.style by Text.propTypes.style causing issue on prod release and React Native >= .0.62 --- src/components/raised-text-button/index.js | 4 ++-- src/components/text-button/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/raised-text-button/index.js b/src/components/raised-text-button/index.js index 22ac30c..a7939d5 100644 --- a/src/components/raised-text-button/index.js +++ b/src/components/raised-text-button/index.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React, { PureComponent } from 'react'; -import { Animated } from 'react-native'; +import { Animated, Text } from 'react-native'; import RaisedButton from '../raised-button'; import { styles } from './styles'; @@ -16,7 +16,7 @@ export default class RaisedTextButton extends PureComponent { title: PropTypes.string.isRequired, titleColor: PropTypes.string, - titleStyle: Animated.Text.propTypes.style, + titleStyle: Text.propTypes.style, disabledTitleColor: PropTypes.string, }; diff --git a/src/components/text-button/index.js b/src/components/text-button/index.js index e8c13b6..3754b4e 100644 --- a/src/components/text-button/index.js +++ b/src/components/text-button/index.js @@ -1,6 +1,6 @@ import PropTypes from 'prop-types'; import React, { PureComponent } from 'react'; -import { Animated } from 'react-native'; +import { Animated, Text } from 'react-native'; import Button from '../button'; import { styles } from './styles'; @@ -21,7 +21,7 @@ export default class TextButton extends PureComponent { title: PropTypes.string.isRequired, titleColor: PropTypes.string, - titleStyle: Animated.Text.propTypes.style, + titleStyle: Text.propTypes.style, disabledTitleColor: PropTypes.string, }; From 2220e88fc68119d896c1d8c7e00d08fb6c45cb3f Mon Sep 17 00:00:00 2001 From: Hafees Olatunji Date: Wed, 8 Apr 2020 12:26:01 +0100 Subject: [PATCH 2/2] Fixed "Animated: 'useNativeDriver' was not specified" Added useNativeDriver to Animated.timing Signed-off-by: Hafees Olatunji --- src/components/button/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/button/index.js b/src/components/button/index.js index d3d9088..c3d48f7 100644 --- a/src/components/button/index.js +++ b/src/components/button/index.js @@ -71,7 +71,7 @@ export default class Button extends PureComponent { let { disableAnimation } = this.state; Animated - .timing(disableAnimation, { toValue: disabled? 1 : 0, duration }) + .timing(disableAnimation, { useNativeDriver: true, toValue: disabled? 1 : 0, duration }) .start(); } } @@ -93,6 +93,7 @@ export default class Button extends PureComponent { toValue: focused? 1 : 0, duration: focusAnimationDuration, easing: Easing.out(Easing.ease), + useNativeDriver: true, }) .start(); }