상세 컨텐츠

본문 제목

[React] Support for the experimental syntax 'decorators-legacy' isn't currently enabled Error

프론트 연구 노트

by bydawn25 2021. 8. 18. 10:27

본문

Step to solve it

 

1. install react-app-rewired from babel

npm install  customize-cra react-app-rewired @babel/plugin-proposal-decorators --save

 

2. Set babel decorator properly in folder

npm install --save-dev @babel/plugin-proposal-decorators

 

3. Intall mobx and mobx-react to use mobx

npm install mobx --save
npm install mobx-react --save

 

4. Change package.json scripts's start to "react-app-rewired start" (others are option for pure running)

"scripts": {
    "start": "react-app-rewired start",  
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  }

 

5. Create config-overrides.js file to root folder

const { override, addDecoratorsLegacy } = require('customize-cra');
module.exports = override(
 addDecoratorsLegacy()
 );

 

 

 

 

It's been a while to write some post 👐

I promise i will visit more often than this

 

*관리자님들 코드 작성할때 에러납니다 고쳐주세용

관련글 더보기