大家好,我正在研究反应应用程序,当我启动它时,它会向我显示此类错误 我正在与dnd做出反应http://react-dnd.github.io/react-dnd/ 你能帮助我吗 ?并提前感谢
这是我的package.json
{
"name": "dndexercice",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.3.1",
"react-dnd": "^2.6.0",
"react-dnd-html5-backend": "^2.6.0",
"react-dom": "^16.3.1",
"react-scripts": "1.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
},
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-eslint": "^7.2.3",
"babel-plugin-transform-decorators": "^6.24.1",
"babel-preset-es2016": "^6.24.1",
"eslint": "^3.19.0",
"eslint-config-rallycoding": "^3.2.0",
"eslint-plugin-react": "^7.7.0"
}
}
答案 0 :(得分:2)
要使用ES7装饰器语法(@
),您需要将transform-decorators plugin添加到您的babel转换器。
npm install --save-dev babel-plugin-transform-decorators
在.babelrc
:
{
"plugins": ["transform-decorators"]
}