[React] --- react in the decorator

A, creact-react-app the decorator

 

  • Run npm run eject allows configuration items created by the create-react-app items exposed

  • At this point, the project more than a config file, and each profile has been exposed. (Before you run npm run eject, to ensure that no local files to be submitted to git)

  • Babel plug-in installationnpm install --save-dev @babel/plugin-proposal-decorators

  • Babel modify configuration file entries package.json

    "babel": {
        "plugins": [
          ["@babel/plugin-proposal-decorators", { "legacy": true }]
        ],
        "presets": [
          "react-app"
        ]
      }

     

 

Guess you like

Origin www.cnblogs.com/nanianqiming/p/11489096.html