一 react中使用mobx:
.首先
npm install --save-dev babel-plugin-transform-decorators-legacy
.之后在package中找到babel配置添加
"plugins": ["transform-decorators-legacy"]
.针对编译器报错
用js 新建jsconfig.json 用typescript 新建jsconfig.json
内容为:
{
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true
}
}