我已经配置了 React Native 和 Native Base。当我为 Android 部署应用程序时,它会抛出一个错误,指出在我的代码中存在 Container 组件的位置附近发现了一个意外的令牌。
我的 package.json 文件是:
{
"name": "React Native POC",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"native-base": "^0.5.18",
"react": "15.4.1",
"react-native": "0.39.2",
"react-redux": "^4.4.6",
"redux": "^3.6.0"
},
"devDependencies": {
"babel-jest": "17.0.2",
"babel-preset-react-native": "1.9.0",
"jest": "17.0.3",
"react-test-renderer": "15.4.1"
},
"jest": {
"preset": "react-native"
}
}
会不会是某些版本不能很好地与其他版本配合使用?另外(如果重要的话)我正在使用 Node 版本 6.8.1、npm 版本 3.10.8 和 react-native-cli 2.0.0。另外,我在全球范围内安装了 yarn、sinopia 和 browserify。
仍然是 React Native 的初学者,我无法判断是否存在任何依赖冲突(明显或其他)
我的js文件是:
import React, {Component} from 'react';
import {Container, Content} from 'native-base';
export default class ReactNativePOC extends Component {
render() {
return {
<Container> // Error here
<Content>
</Content>
</Container>
}
}
}
我的设置(不包括本机基础)似乎没有任何问题,因为我可以使用默认控件运行一个反应本机应用程序但是我似乎只在本机基础控件中遇到此错误