many-react-demo
many-react-demo copied to clipboard
关于应用mobx时因为缺少ES7的Decorators支持而报错的问题
在Counter的demo中应用了mobx, 但是开始运行的时候总是报错,报错信息如下
Decorators are not officially supported yet in 6.x pending a proposal update.
However, if you need to use them you can install the legacy decorators transform with:
npm install babel-plugin-transform-decorators-legacy --save-dev
and add the following line to your .babelrc file:
{
"plugins": ["transform-decorators-legacy"]
}
Decorators 装饰者模式是ES7中提案,要支持这个需要安装一个babel-plugin-transform-decorators-legacy 的插件,并且需要修改.babelrc中的配置