【发布时间】:2016-12-07 09:33:23
【问题描述】:
我是 react-native 的新手,我在 Windows 7 上使用 Atom GUI 1.12.6 并在 Android 手机中使用 Exponent 部署应用程序 这是我的代码
'use strict';
import Exponent from 'exponent';
import React, {Component} from 'react';
import { AppRegistry, Text } from 'react-native';
class App extends Component{
constructor(props, context) {
super(props, context);
this.state = {
};
}
render(){}
return (
<Text>Hello world again!</Text>
);
}
}
Exponent.registerRootComponent(App);
.eslintrc 文件包含规则:
{
"extends": "airbnb/base",
"plugins": [
"react"
],
"env": {
"node": true,
"jasmine": true,
},
"rules": {
"indent": [1, 4],
"no-console": 0,
"no-unused-vars": [1, {"vars": "local", "args": "none"}],
"react/forbid-prop-types": 1,
"react/jsx-boolean-value": 1,
"react/jsx-closing-bracket-location": 1,
"react/jsx-curly-spacing": 1,
"react/jsx-indent-props": 1,
"react/jsx-key": 1,
"react/jsx-max-props-per-line": 1,
"react/jsx-no-duplicate-props": 1,
"react/jsx-no-undef": 1,
"react/jsx-quotes": 1,
"react/jsx-sort-prop-types": 1,
"react/jsx-sort-props": 1,
"react/jsx-uses-react": 1,
"react/jsx-uses-vars": 1,
"react/no-danger": 1,
"react/no-did-mount-set-state": 1,
"react/no-did-update-set-state": 1,
"react/no-direct-mutation-state": 1,
"react/no-multi-comp": 1,
"react/no-set-state": 1,
"react/no-unknown-property": 1,
"react/prefer-es6-class": 1,
"react/prop-types": 1,
"react/react-in-jsx-scope": 1,
"react/require-extension": 1,
"react/self-closing-comp": 1,
"react/sort-comp": 1,
"react/wrap-multilines": 1,
"id-length": 0,
},
"ecmaFeatures": {
"jsx": true
},
}
出现错误: 在文本控件的 Atom 编辑器中,它显示“解析错误:意外令牌
【问题讨论】:
标签: react-native