React Native Video - undefined is not an object (evaluating '_reactNative.Image.propTypes.resizeMode'

Viewed 1439

I'm using react-native-video in react-native v0.69 withing nx monorepo and when trying to add Video component like below, I get an error TypeError: undefined is not an object (evaluating '_reactNative.Image.propTypes.resizeMode'.

import Video from 'react-native-video'

  <Video
     resizeMode="none"
     source={{ uri: _.url }}
     style={{ width: 64, height: 64 }}
  />

When i remove resizeMode prop I get same error. What is causing this?

3 Answers

I've managed to solve it. For react-native 0.69,^6.0.0-alpha.1 version of react-native-video fix the issue

We have to install 6.0.0-alpha.1, but pod install can give some errors. But those error's can be resolved using below commands:

sudo arch -x86_64 gem install ffi

and then go to the iOs folder and run:

arch -x86_64 pod install

It will work.

Go to the package.json file and remove:

"react-native-video": "^6.0.0-alpha.1"

Then type: npm i in terminal

Related