简体   繁体   English

undefined不是一个函数(评估React.createClass)

[英]undefined is not an function (evaluating React.createClass)

I want to create a simple app with react native on android. 我想用Android上的react native创建一个简单的应用程序。 I used this source code for create Toolbar: https://rnplay.org/apps/CHOsPg But I got this error: 我使用此源代码来创建工具栏: https : //rnplay.org/apps/CHOsPg但出现此错误:

undefined is not an function (evaluating React.createClass)

How can i solve this? 我该如何解决?

Import React from react package, and the rest from react-native , like: react包中导入React,其余的从react-native导入,例如:

import React from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  ToolbarAndroid
} from 'react-native';

Example: https://rnplay.org/apps/nKECFw 示例: https//rnplay.org/apps/nKECFw

Here first run the command as 在这里首先运行命令为

brew install node

And then 接着

react-native start --reset-cache
react-native run-androd

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM