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.contain') #132

Open Asinox opened 6 years ago

Asinox commented 6 years ago

Hello there!, first, thank you for this great library.

Now Im trying to follow you example code, and I don't know if I'm missing something here, but I'm facing this issue:

TypeError: undefined is not an object (evaluating '_reactNative.Image.resizeMode.contain')

This error is located at:
    in exports (at UserFormPoliza.js:72)
    in RCTView (at View.js:43)
    in RCTScrollView (at ScrollView.js:1070)
    in ScrollView (at ContainerMixin.js:129)
    in GiftedForm (at UserFormPoliza.js:34)
    in RCTView (at View.js:43)
    in RCTScrollView (at ScrollView.js:1070)
    in ScrollView (at KeyboardAwareHOC.js:397)
    in _class (at Content.js:125)
    in Content (at connectStyle.js:384)
    in Styled(Content) (at UserFormPoliza.js:32)
    in RCTView (at View.js:43)
    in Container (at connectStyle.js:384)
    in Styled(Container) (at UserFormPoliza.js:31)
    in UserFormPoliza (at SceneView.js:9)
    in SceneView (at StackViewLayout.js:563)
    in RCTView (at View.js:43)
    in RCTView (at View.js:43)
    in RCTView (at View.js:43)
    in AnimatedComponent (at StackViewCard.js:12)
    in Card (at createPointerEventsContainer.js:28)
    in Container (at StackViewLayout.js:612)
    in RCTView (at View.js:43)
    in RCTView (at View.js:43)
    in StackViewLayout (at withOrientation.js:30)
    in withOrientation (at StackView.js:63)
    in RCTView (at View.js:43)
    in Transitioner (at StackView.js:21)
    in StackView (at createNavigator.js:59)
    in Navigator (at createKeyboardAwareNavigator.js:11)
    in KeyboardAwareNavigator (at createNavigationContainer.js:376)
    in NavigationContainer (at App.js:94)
    in App (at renderApplication.js:32)
    in RCTView (at View.js:43)
    in RCTView (at View.js:43)
    in AppContainer (at renderApplication.js:31)

Any idea (I'm new with RN)

Thanks!

sunilkumarkm commented 5 years ago

That's because since 0.56 Image.resizeMode is not exposed anymore. You just need to use the string value instead.

ex: resizeMode="contain"

Q8hma commented 5 years ago

Hello im new on RN how to fix it ??? can you please help me

thnx

lekhnath commented 5 years ago

I am also getting this error message when using following code snippet. Need help ASAP.

<GiftedForm.ModalWidget
        title='Title'
        displayValue='title'
      >
        <GiftedForm.SeparatorWidget />

        <GiftedForm.SelectWidget name='title' title='Title' multiple={false}>
          <GiftedForm.OptionWidget title='Male' value='M'/>
          <GiftedForm.OptionWidget  title='Female' value='F'/>
        </GiftedForm.SelectWidget>
      </GiftedForm.ModalWidget>
q854284771 commented 5 years ago

find the WidgetMixin.js and ModalWidget.js in source code and press ctrl + F to replace Image.resizeMode.contain to 'contain'

itgou commented 5 years ago

find the WidgetMixin.js and ModalWidget.js in source code and press ctrl + F to replace Image.resizeMode.contain to 'contain'

Thank you! I solved this problem by your help!!!

mengbimao commented 4 years ago

I think the authorities should fix this(WidgetMixin.js ->Image.resizeMode.contain to 'contain')