djchie/react-native-star-rating

Cannot read property 'allowFontScaling' of undefined

Closed this issue · 7 comments

android
RN 0.7
image

👍
same issue

same issue

react-native 0.68.2 - works,
react-native 0.70.0 - not works

I have this same issue with react-native 0.70.6

Same issue now.

i have this same issue with react native 0.70

if you're using patch package react-native-star-rating needs this patch

diff --git a/node_modules/react-native-star-rating/StarButton.js b/node_modules/react-native-star-rating/StarButton.js
index b6db613..d65d673 100644
--- a/node_modules/react-native-star-rating/StarButton.js
+++ b/node_modules/react-native-star-rating/StarButton.js
@@ -1,6 +1,7 @@
 // React and react native imports
 import React, { Component } from 'react';
-import { Image, StyleSheet, ViewPropTypes } from 'react-native';
+import { Image, StyleSheet } from 'react-native';
+import {ViewPropTypes} from 'deprecated-react-native-prop-types'
 import PropTypes from 'prop-types';
 import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
 
diff --git a/node_modules/react-native-star-rating/StarRating.js b/node_modules/react-native-star-rating/StarRating.js
index 7aecc95..1322255 100644
--- a/node_modules/react-native-star-rating/StarRating.js
+++ b/node_modules/react-native-star-rating/StarRating.js
@@ -1,6 +1,7 @@
 // React and react native imports
 import React, { Component } from 'react';
-import { View, ViewPropTypes, StyleSheet } from 'react-native';
+import { View, StyleSheet } from 'react-native';
+import {ViewPropTypes} from 'deprecated-react-native-prop-types'
 import PropTypes from 'prop-types';
 import { View as AnimatableView } from 'react-native-animatable';

and react-native-button needs this patch

diff --git a/node_modules/react-native-button/Button.js b/node_modules/react-native-button/Button.js
index fb7cf46..594b4b4 100644
--- a/node_modules/react-native-button/Button.js
+++ b/node_modules/react-native-button/Button.js
@@ -5,9 +5,9 @@ import {
   Text,
   TouchableOpacity,
   View,
-  ViewPropTypes,
+  TextStyle,
 } from 'react-native';
-
+import {ViewPropTypes} from 'deprecated-react-native-prop-types'
 import coalesceNonElementChildren from './coalesceNonElementChildren';
 
 const systemButtonOpacity = 0.2;
@@ -16,12 +16,12 @@ export default class Button extends Component {
   static propTypes = {
     ...TouchableOpacity.propTypes,
     accessibilityLabel: PropTypes.string,
-    allowFontScaling: Text.propTypes.allowFontScaling,
+    allowFontScaling: PropTypes.bool,
     containerStyle: ViewPropTypes.style,
     disabledContainerStyle: ViewPropTypes.style,
     disabled: PropTypes.bool,
-    style: Text.propTypes.style,
-    styleDisabled: Text.propTypes.style,
+    style: PropTypes.shape(TextStyle),
+    styleDisabled: PropTypes.shape(TextStyle),
     childGroupStyle: ViewPropTypes.style,
   };