From ae0c88d69ed4020de1dbb9574895c3c91dd4b58c Mon Sep 17 00:00:00 2001 From: "jaafar.abusair" Date: Mon, 18 Dec 2017 23:08:12 +0200 Subject: [PATCH 1/2] supporting react 15.5+ --- index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index d65bf4c0..e901351a 100644 --- a/index.js +++ b/index.js @@ -1,8 +1,6 @@ 'use strict'; -import React,{ - PropTypes -} from 'react'; +import React from 'react'; import { View, @@ -17,6 +15,7 @@ import { import styles from './style'; import BaseComponent from './BaseComponent'; +import PropTypes from 'prop-types'; let componentIndex = 0; From 34209456f4ecc166e6ec835c2adc819982dee2d1 Mon Sep 17 00:00:00 2001 From: "jaafar.abusair" Date: Sun, 8 Apr 2018 22:11:36 +0300 Subject: [PATCH 2/2] Support rn 51+ --- index.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index e901351a..ed9530ae 100644 --- a/index.js +++ b/index.js @@ -10,7 +10,8 @@ import { Text, ScrollView, TouchableOpacity, - Platform + Platform, + ViewPropTypes } from 'react-native'; import styles from './style'; @@ -23,15 +24,15 @@ const propTypes = { data: PropTypes.array, onChange: PropTypes.func, initValue: PropTypes.string, - style: View.propTypes.style, - selectStyle: View.propTypes.style, - optionStyle: View.propTypes.style, + style: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, + selectStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, + optionStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, optionTextStyle: Text.propTypes.style, - sectionStyle: View.propTypes.style, + sectionStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, sectionTextStyle: Text.propTypes.style, - cancelStyle: View.propTypes.style, + cancelStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, cancelTextStyle: Text.propTypes.style, - overlayStyle: View.propTypes.style, + overlayStyle: ViewPropTypes ? ViewPropTypes.style : View.propTypes.style, cancelText: PropTypes.string };