情况通报:

因为是我的二维码模块报错,提示报错代码如下

重要信息是下面的红色字体部分(Android 模拟器红屏)

undefined is not an object (evaluating '_react2.PropTypes.func')
<unknown>
D:\CDM_POS_APP\pos_shouy\node_modules\react-native-smart-barcode\Barcode.js:38:33
loadModuleImplementation
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:178:12
guardedLoadModule
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:130:36
_require
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:110:20
<unknown>
D:\CDM_POS_APP\pos_shouy\src\QrcodeView.js:17
loadModuleImplementation
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:178:12
guardedLoadModule
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:130:36
_require
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:110:20
<unknown>
D:\CDM_POS_APP\pos_shouy\App.js:31
loadModuleImplementation
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:178:12
guardedLoadModule
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:130:36
_require
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:110:20
<unknown>
D:\CDM_POS_APP\pos_shouy\index.js:2
loadModuleImplementation
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:178:12
guardedLoadModule
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:123:45
_require
D:\CDM_POS_APP\pos_shouy\node_modules\metro-bundler\src\Resolver\polyfills\require.js:110:20
global code

解决办法:

找到错误位置的:D:\CDM_POS_APP\pos_shouy\node_modules\react-native-smart-barcode\Barcode.js

PropTypes 放在了react 中引入,但是还是出错
Undefined is not an object(evaluating ‘_react2.PropTypes.func’)

正确写法:

import React, { Component } from 'react';

import PropTypes from 'prop-types';

把PropTypes 从prop-types 中引入

最终截图:

react-native 编译 undefined is not an object (evaluating '_react2.PropTypes.func')的更多相关文章

  1. react-native 编译报错: undefined is not an object (evaluating '_react2.PropTypes.func')

    情况通报: 因为是我的二维码模块报错,提示报错代码如下 重要信息是下面的红色字体部分(Android 模拟器红屏) undefined is not an object (evaluating '_r ...

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

    对所引用的组件原 .import React, {Component,PropTypes} from 'react' 改成:import React, {Component} from 'react' ...

  3. React-native-camera error with Expo: undefined is not an object (evaluating 'CameraManager.Aspect')

    React-native-camera error with Expo: undefined is not an object (evaluating 'CameraManager.Aspect') ...

  4. 使用react-navigation时报错:undefined is not an object (evaluating rngesturehandlermodule.direction)

    问题: 使用react-navigation时报错:undefined is not an object (evaluating rngesturehandlermodule.direction). ...

  5. react native出现 undefined is not a function_this4.错误函数无法识别

    该函数可能里可能有this,的上个函数this要绑定bind(this)

  6. React Native Expected a component class,got [object Object]解决

    报错原因: 组件大小写错误. 解决方式: 修改组件名称即可. 这篇博客介绍了大部分RN的错误原因和解决方法: http://blog.csdn.net/chichengjunma/article/de ...

  7. undefined is not an object (evaluating 'RNFetchBlob.DocumentDir')

    参考https://github.com/wkh237/react-native-fetch-blob/issues/51 自己做了一下总结: 这个报错位置在react-native-fetch-bl ...

  8. undefined is not an object(evaluating '_react3.default.PropTypes.shape)

    手机红屏报这个错时的解决办法: npm uninstall --save react-native-deprecated-custom-components npm install --save ht ...

  9. React Native随笔——警告处理方法(持续更新)

    一.警告propTypes was defined as an instance property on commonTabar. Use a static property to define pr ...

随机推荐

  1. 解决MYSQL的错误:Got a packet bigger than 'max_allowed_packet' bytes

    Mysql 5.1开始遇到的信息包过大问题,当用客户端导入数据的时候,遇到错误代码: 1153 - Got apacket bigger than 'max_allowed_packet' bytes ...

  2. luoguP1002

    p1002 题意: 从坐标A到坐标B的可能路线(有一些点不能走)情况,很明显可以看出用dp做 m[i][j]=m[i-1][j]+m[i][j-1](注意处理不能走的点) 自己在初始化时犯了错,第1行 ...

  3. C语言基本语法——字符串

    1.什么是字符串 2.字符串与普通字符数组的区别 3.字符串的定义方式 4.字符串的使用 5.什么是字符串数组 6.字符串数组的赋值 7.字符串数组的遍历 1.什么是字符串 • 用双引号引起来的多个字 ...

  4. Vim 学习指南

    作者:耀耀 出处:http://www.linuxeden.com/html/news/20130820/142667.html Vim 学习指南 来源:开源中国社区 作者:耀耀 关注我们:   你想 ...

  5. php数组 匹配键值

    1.array_search() //判断键值是否在数组中,//存在,返回值对应的键;//不存在,返回false;//例子:$type = array( "选考" => 'o ...

  6. 通过rpm安装jdk

    通过rpm安装,安装在/usr/local 1 .编辑系统环境变量 vi /etc/profile 输入i 加入内容如下: export JAVA_HOME=/usr/local/jdk1.7.0_7 ...

  7. 题解 P3978 【[TJOI2015]概率论】

    这道题...好像是第一道我自己切出来的黑题... 先说一句,牛顿二项式蒟蒻并不会,可以说是直接套结论. 求诸位老爷轻喷. 这道题用卡特兰数搞. 卡特兰数这玩意从普及组初赛一路考到省选,十分有用. 如果 ...

  8. springboot项目封装为docker镜像

    1.本次镜像的基础镜像是:https://www.cnblogs.com/JoeyWong/p/9173265.html 2.将打包好的项目文件放在与Dockerfile同级的目录下 3.Docker ...

  9. spring boot和maven的约定大于配置体现在哪些方面

    spring boot和maven的约定大于配置体现在哪些方面? 两者都遵从了约定大于配置的路线 约定优于配置体现点: 1.maven的目录文件结构 1)默认有resources文件夹,存放资源配置文 ...

  10. LeetCode OJ 之 Number of Digit One (数字1的个数)

    题目: Given an integer n, count the total number of digit 1 appearing in all non-negative integers les ...