情况通报:

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

重要信息是下面的红色字体部分(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. WoSign全球可信网站安全认证签章安装指南

    您购买了WoSign SSL证书后,将免费获得一个能直观地显示贵网站的认证信息的可信网站安全认证标识,能大大增强用户的在线信任,促成更多在线交易.所以,建议您在安装成功SSL证书后马上在网站的首页和其 ...

  2. Spark作业执行

    Spark中一个action触发一个job的执行,在job提交过程中主要涉及Driver和Executor两个节点. Driver主要解决 1. RDD 依赖性分析,生成DAG. 2. 根据RDD D ...

  3. Jetty初探

    一.在jetty中部署web应用 Jetty 和 Tomcat 一样都是一个web server的container, 用户可以在里面 deploy 自己的 war 包,然后启动 Jetty, 进而通 ...

  4. Vue文件封装日历组件

    封装就是要具有灵活性,样式自适应,调用的时候传入props就可以变成自己想要的样式. 效果展示网址:https://1963331542.github.io/ 源代码: <template> ...

  5. oc基础知识

    只在@interface中定义变量的话,你所定义的变量只能在当前的类中访问,在其他类中是访问不了的:而用@property声明的变量可以在外部访问. 用了@property去声明的变量,可以使用“se ...

  6. crm 系统项目(二) admin 后台操作表格

    crm 系统项目(二) admin 后台操作表格 1. app下创建 templates  运行的时候 先找全局的templates——> 按照app的注册顺序找templates中的文件 2. ...

  7. VUE:渐进式JavaScript框架(小白自学)

    VUE:渐进式JavaScript框架 一.官网 英文 https://vuejs.org/ 中文 https://cn.vuejs.org/ 二:渐进式 即有一个核心库,在需要的时候再逐渐添加插件的 ...

  8. 报错:SyntaxError: Non-ASCII character '\xe4' in file

    SyntaxError: Non-ASCII character '\xe1' in file recommendation.py on line 1, but no encoding declare ...

  9. Eclipse删除多余工作空间

    选择perferences-->General -->Startup and Shutdown-->workspace-->选择多余的工作空间 -> remove -&g ...

  10. POJ3684 Physics Experiment 【物理】

    Physics Experiment Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 1031   Accepted: 365 ...