From 05a8404368c6a3f4659f900a4d5b829b7f15fa58 Mon Sep 17 00:00:00 2001 From: DreamApart Date: Tue, 14 Nov 2017 19:32:27 +0800 Subject: [PATCH 1/2] Changed to `ViewPropTypes` Using `View.propTypes` in newer versions of react-native causes crash in release mode. --- src/components/SwipeRow.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/SwipeRow.js b/src/components/SwipeRow.js index e3b5d18..ccc631c 100644 --- a/src/components/SwipeRow.js +++ b/src/components/SwipeRow.js @@ -4,7 +4,8 @@ import { StyleSheet, View, Animated, - Easing + Easing, + ViewPropTypes } from 'react-native'; import createReactClass from 'create-react-class'; @@ -42,12 +43,12 @@ const defaultSubViewOptions = { const SwipeRow = createReactClass({ propTypes: { - style: View.propTypes.style, + style: ViewPropTypes.style, id: PropTypes.oneOfType([ PropTypes.number, PropTypes.string ]).isRequired, - rowViewStyle: View.propTypes.style, + rowViewStyle: ViewPropTypes.style, gestureTensionParams: PropTypes.shape({ threshold: PropTypes.number, stretch: PropTypes.number, @@ -636,4 +637,4 @@ const styles = StyleSheet.create({ }); -export default SwipeRow; \ No newline at end of file +export default SwipeRow; From 952277fddc0b094183da3c3f6b72f3470c6a3ac5 Mon Sep 17 00:00:00 2001 From: DreamApart Date: Tue, 14 Nov 2017 19:35:22 +0800 Subject: [PATCH 2/2] Changed to `ViewPropTypes` --- src/components/SwipeList.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/SwipeList.js b/src/components/SwipeList.js index b5c5f8d..65942b8 100644 --- a/src/components/SwipeList.js +++ b/src/components/SwipeList.js @@ -1,6 +1,6 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { StyleSheet, View, ListView, ScrollView } from 'react-native'; +import { StyleSheet, View, ListView, ScrollView, ViewPropTypes } from 'react-native'; import createReactClass from 'create-react-class'; import shallowCompare from 'react-addons-shallow-compare'; import reduce from 'lodash/reduce'; @@ -38,8 +38,8 @@ const SwipeList = createReactClass({ } } }, - style: View.propTypes.style, - rowStyle: View.propTypes.style, + style: ViewPropTypes.style, + rowStyle: ViewPropTypes.style, scrollEnabled: PropTypes.bool, onScrollStateChange: PropTypes.func, gestureTensionParams: PropTypes.shape({ @@ -320,4 +320,4 @@ const styles = StyleSheet.create({ SwipeList.SwipeState = SWIPE_STATE; -export default SwipeList; \ No newline at end of file +export default SwipeList;