FaridSafi / react-native-gifted-form

๐Ÿ“ ยซ One React-Native form component to rule them all ยป
MIT License
1.44k stars 214 forks source link

TypeError: undefined is not an object (evaluating '_reactNative.Image.resizeMode.cover') #146

Open CarmineRumma opened 2 years ago

CarmineRumma commented 2 years ago

Hi! ๐Ÿ‘‹

Firstly, thanks for your work on this project! ๐Ÿ™‚

TypeError: undefined is not an object (evaluating '_reactNative.Image.resizeMode.cover') Here is the diff that solved my problem:

diff --git a/node_modules/react-native-gifted-form/mixins/WidgetMixin.js b/node_modules/react-native-gifted-form/mixins/WidgetMixin.js
index e6d9339..763d5e0 100644
--- a/node_modules/react-native-gifted-form/mixins/WidgetMixin.js
+++ b/node_modules/react-native-gifted-form/mixins/WidgetMixin.js
@@ -219,7 +219,7 @@ module.exports = {
       return (
         <Image
           style={this.getStyle('rowImage')}
-          resizeMode={Image.resizeMode.contain}
+          resizeMode={'contain'}
           source={imageSrc}
         />
       );
@@ -231,7 +231,7 @@ module.exports = {
       return (
         <Image
           style={this.getStyle('rowImage')}
-          resizeMode={Image.resizeMode.contain}
+          resizeMode={'contain'}
           source={this.props.image}
         />
       );
diff --git a/node_modules/react-native-gifted-form/widgets/ModalWidget.js b/node_modules/react-native-gifted-form/widgets/ModalWidget.js
index 6323f84..2240d12 100644
--- a/node_modules/react-native-gifted-form/widgets/ModalWidget.js
+++ b/node_modules/react-native-gifted-form/widgets/ModalWidget.js
@@ -54,7 +54,7 @@ module.exports = createReactClass({
       return (
         <Image
           style={this.getStyle('disclosure')}
-          resizeMode={Image.resizeMode.contain}
+          resizeMode={'contain'}
           source={require('../icons/disclosure.png')}
         />
       );
@@ -114,7 +114,7 @@ module.exports = createReactClass({
                   marginLeft: 10,
                   tintColor: '#097881',
                 }}
-                resizeMode={Image.resizeMode.contain}
+                resizeMode={'contain'}
                 source={require('../icons/close.png')}
               />
             </TouchableOpacity>
@@ -139,7 +139,7 @@ module.exports = createReactClass({
                 marginRight: 10,
                 tintColor: '#097881',
               }}
-              resizeMode={Image.resizeMode.contain}
+              resizeMode={'contain'}
               source={require('../icons/check.png')}
             />
           </TouchableOpacity>
diff --git a/node_modules/react-native-gifted-form/widgets/OptionWidget.js b/node_modules/react-native-gifted-form/widgets/OptionWidget.js
index 34210ae..a32d027 100644
--- a/node_modules/react-native-gifted-form/widgets/OptionWidget.js
+++ b/node_modules/react-native-gifted-form/widgets/OptionWidget.js
@@ -27,7 +27,7 @@ module.exports = createReactClass({
       return (
         <Image
           style={this.getStyle('checkmark')}
-          resizeMode={Image.resizeMode.contain}
+          resizeMode={'contain'}
           source={require('../icons/check.png')}
         />
       );
diff --git a/node_modules/react-native-gifted-form/widgets/RowWidget.js b/node_modules/react-native-gifted-form/widgets/RowWidget.js
index c0a35bb..0d8eb27 100644
--- a/node_modules/react-native-gifted-form/widgets/RowWidget.js
+++ b/node_modules/react-native-gifted-form/widgets/RowWidget.js
@@ -28,7 +28,7 @@ module.exports = createReactClass({
       return (
         <Image
           style={this.getStyle('disclosure')}
-          resizeMode={Image.resizeMode.contain}
+          resizeMode={'contain'}
           source={require('../icons/disclosure.png')}
         />
       );
diff --git a/node_modules/react-native-gifted-form/widgets/SelectCountryWidget.js b/node_modules/react-native-gifted-form/widgets/SelectCountryWidget.js
index 130d8f8..c018763 100644
--- a/node_modules/react-native-gifted-form/widgets/SelectCountryWidget.js
+++ b/node_modules/react-native-gifted-form/widgets/SelectCountryWidget.js
@@ -1857,7 +1857,7 @@ module.exports = createReactClass({
           }}>
             <Image
               key={rowData.alpha2+'Image'}
-              resizeMode={Image.resizeMode.contain}
+              resizeMode={'contain'}
               source={image}
               style={{
                 height: 30,