1

Getting

undefined is not an object ( evaluating '_react2.PropTypes.oneOfType')

While using react-native-camera .

using react-native-camera@0.6 with following react native version.

react-native-cli: 2.0.1
react-native: 0.55.2

What i tried inside app.js is

import React, { Component, PropTypes } from 'react';

and

import PropTypes from 'prop-types';

But not worked.

Shibin Raju Mathew
  • 920
  • 4
  • 18
  • 41

1 Answers1

4

PropTypes package has been separated from react since v15.5 as mentioned here

Since you're using an older version of react-native-camera, therefore they contain old dependencies in their index.js

react-native-camera index.js v0.6 contains

import React, { Component, PropTypes } from 'react';

Therefore you need to update the package since they have major changes and revamped folder structure as seen in Camera.js

Pritish Vaidya
  • 21,561
  • 3
  • 58
  • 76