我配置了 package.json 和 babelrc,但是在使用装饰器时出现了一些错误。
我使用“react16.8.1”和“mobx5.9.4”。
我的 babelrc 代码:
"presets": [
"@babel/preset-env",
"@babel/preset-react",
],
"plugins": [
"@babel/plugin-transform-runtime",
"@babel/plugin-transform-object-assign",
[
"@babel/plugin-decorators-legacy",
{
"legacy": true
}
],
]
}```
and my package.json
Run Code Online (Sandbox Code Playgroud)
{
"name": "material-dashboard-pro-react",
"version": "1.5.0",
"private": true,
"dependencies": {
"@material-ui/core": "3.9.2",
"@material-ui/icons": "3.0.2",
"axios": "^0.18.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"chartist": "0.10.1",
"history": "4.7.2",
"mobx": "^5.9.4",
"mobx-react": "^5.4.3",
"moment": "2.24.0",
"moment-jalaali": "^0.8.3",
"node-sass": "4.11.0",
"nouislider": "13.1.0",
"perfect-scrollbar": "1.4.0",
"rc-pagination": "^1.17.13",
"react": "16.8.1",
"react-big-calendar": "0.20.3",
"react-bootstrap-sweetalert": "4.4.1",
"react-chartist": "0.13.3",
"react-datetime": "2.16.3",
"react-dom": "16.8.1",
"react-google-maps": "9.4.5", …Run Code Online (Sandbox Code Playgroud)