Я настроил мои package.json и babelrc, но у меня возникли ошибки при использовании декораторов.
Я использую «act16.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
{
"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",
"react-hichestan-datetimepicker": "^0.2.12",
"react-jvectormap": "0.0.6",
"react-router-dom": "4.3.1",
"react-scripts": "2.1.5",
"react-select": "^2.4.2",
"react-swipeable-views": "0.13.1",
"react-table": "6.9.2",
"react-tagsinput": "3.19.0",
"react-toastify": "^5.0.0",
"simple-react-modal": "^0.5.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"deploy": "npm run build",
"lint:check": "eslint . --ext=js,jsx; exit 0",
"lint:fix": "eslint . --ext=js,jsx --fix; exit 0",
},
"optionalDependencies": {
"@types/googlemaps": "3.30.16",
"@types/markerclustererplus": "2.1.33",
"ajv": "6.9.1",
"prettier": "1.16.4"
},
"devDependencies": {
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-preset-mobx": "^2.0.0",
"eslint-config-prettier": "4.0.0",
"eslint-plugin-prettier": "3.0.1"
},
"babel": {
"presets": [
"react-app",
"mobx"
],
"plugins": [
[
"@babel/plugin-decorators-legacy",
{
"legacy": true
}
]
]
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
Я использовал его раньше, и он работал нормально, но после обновления реакции и mobx я получаю эту ошибку: «Поддержка экспериментального синтаксиса« decorators-legacy »в настоящее время не включена»