我正在尝试使用React创建一个组件。我已经完成了代码,但是当运行"纱线运行捆绑"时,代码出错并且我收到错误代码
"模块构建失败:SyntaxError:意外的令牌(9:10)"
以下是我收到错误的地方。谁能想到为什么?
export class NewBond extends React.Component {
state = {name:''};
Package.json
{
"name": "react-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node --use_strict index.js",
"dev": "nodemon --use_strict index.js",
"bundle": "webpack"
},
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.16.1",
"bcryptjs": "^2.4.3",
"body-parser": "^1.17.2",
"express": "^4.15.3",
"jsonwebtoken": "^7.4.1",
"material-ui": "^0.18.1",
"mongoose": "^4.10.4",
"passport": "^0.3.2",
"passport-local": "^1.0.0",
"prop-types": "^15.5.10",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-router": "^4.1.1",
"react-router-dom": "^4.1.1",
"react-tap-event-plugin": "^2.0.1",
"semantic-ui-react": "^0.78.3",
"validator": "^7.0.0",
"yarn": "^1.5.1"
},
"devDependencies": {
"babel-core": "^6.24.1",
"babel-loader": "^7.0.0",
"babel-plugin-transform-es2015-destructuring": "^6.23.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"nodemon": "^1.11.0",
"webpack": "^2.6.1"
}
}