Skip to content

propTypes issue with react-native 0.75.1 #284

@1pinkmann

Description

@1pinkmann

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

react-native-material-* packages don't support react-native 0.75.1. The issue is that there is no more ViewPropTypes or prop types of a particular view components, like Text, in this react-native version. So I had to make all your components use only PropTypes.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-material-dropdown/src/components/dropdown/index.js b/node_modules/react-native-material-dropdown/src/components/dropdown/index.js
index b1e65a1..a39bb62 100644
--- a/node_modules/react-native-material-dropdown/src/components/dropdown/index.js
+++ b/node_modules/react-native-material-dropdown/src/components/dropdown/index.js
@@ -9,7 +9,6 @@ import {
   TouchableWithoutFeedback,
   Dimensions,
   Platform,
-  ViewPropTypes,
   I18nManager,
 } from 'react-native';
 import Ripple from 'react-native-material-ripple';
@@ -133,7 +132,7 @@ export default class Dropdown extends PureComponent {
     disabledItemColor: PropTypes.string,
     baseColor: PropTypes.string,
 
-    itemTextStyle: Text.propTypes.style,
+    itemTextStyle: PropTypes.string,
 
     itemCount: PropTypes.number,
     itemPadding: PropTypes.number,
@@ -146,9 +145,9 @@ export default class Dropdown extends PureComponent {
     renderBase: PropTypes.func,
     renderAccessory: PropTypes.func,
 
-    containerStyle: (ViewPropTypes || View.propTypes).style,
-    overlayStyle: (ViewPropTypes || View.propTypes).style,
-    pickerStyle: (ViewPropTypes || View.propTypes).style,
+    containerStyle: PropTypes.object,
+    overlayStyle: PropTypes.object,
+    pickerStyle: PropTypes.object,
 
     supportedOrientations: PropTypes.arrayOf(PropTypes.string),
 
@@ -610,12 +609,12 @@ export default class Dropdown extends PureComponent {
       label;
 
     let color = disabled?
-      disabledItemColor:
-      ~selected?
+      disabledItemColor :
+      ~selected ?
         index === selected?
           selectedItemColor:
           itemColor:
-        selectedItemColor;
+          itemColor;
 
     let textStyle = { color, fontSize };
 

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions