当前位置: 代码迷 >> 综合 >> undefined is not an object(evaluating '_react2.PropTypes.oneOfType')
  详细解决方案

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

热度:50   发布时间:2023-12-26 02:43:51.0

解决办法:

https://github.com/react-native-community/react-native-camera/issues/1005

If you use react-native-camera version 0.6.0, PropTypes import from React package

// react-native-camera/index.js
import React, { Component, PropTypes } from 'react';

And if you use React version 15.5.0 or higher, PropTypes move to own package (reference: https://reactjs.org/blog/2017/04/07/react-v15.5.0.html), have to change import follow this

// react-native-camera/index.js
import React, { Component } from 'react';
import PropTypes from 'prop-types';

Update to the latest version (It's fixed on version 0.10.0)


  相关解决方案