lovebing / react-native-baidu-map

Baidu Map SDK modules and views for React Native(Android & iOS), support react native 0.61+. 百度地图 React Native 模块,支持 react native 0.61+,已更新到最新的百度地图SDK版本。
MIT License
846 stars 322 forks source link

跑不起来啊,这是什么梗 #148

Open PingShuPeng opened 6 years ago

PingShuPeng commented 6 years ago

undefined is not an object (evaluating 'a.PropTypes.bool') Module AppRegistry is not a registered callable module (calling runApplication) 11-29 16:45:07.045 10616-10719/com.mymall E/AndroidRuntime: FATAL EXCEPTION: mqt_native_modules Process: com.mymall, PID: 10616 com.facebook.react.common.JavascriptException: undefined is not an object (evaluating 'a.PropTypes.bool'), stack:

puti94 commented 6 years ago

进入源代码修改MapView.js PropTypes导入换成这个 import PropTypes from 'prop-types'; 估计是这个问题

brusyy commented 6 years ago

import React ,{PropTypes}from'react';这句话不能用了,react直接把Proptypes放到单独的库里面了。改为

const PropTypes = require('prop-types');这样的话很多第三方库都要改,最好的方式是直接将react的index改为:

'use strict';

import PropTypes from'prop-types';

letReact;

if(process.env.NODE_ENV ==='production') {

React = require('./cjs/react.production.min.js');

}else{

React = require('./cjs/react.development.js');

}

React.PropTypes = PropTypes;

module.exports = React;

、、、、、、、、、、、、、、、、、、、、、