PHP高级工程师|全栈工程师|WX: Aben_Ring

箭头函数报错:Add @babel/plugin-proposal-class-properties (https://git.io/vb4SL) to the 'plugins' section of your Babel config to enable transformation.

解决:根目录新建babel.config.js加入如下内容

module.exports = {
    presets: [ "@babel/preset-env", "@babel/preset-react" ],
    plugins: [ "@babel/plugin-transform-arrow-functions", "@babel/plugin-proposal-class-properties" ]
}
posted @ 2019-07-22 16:58  懒牛拉车  阅读(7280)  评论(0编辑  收藏  举报