react mobx 报错 Missing class properties transform
1 react mobx 项目 执行会报错 react mobx 报错 Missing class properties transform ,已安装了transform-decorators-legacy和transform-class-properties,不知道哪里出问题了
store/countStore.js
import { observable, action, computed, runInAction, autorun, extendObservable } from 'mobx';
class CountStore {
@observable num = 0;
constructor(props){
}
}
export default CountStore;
components/index.jsx
import React, { Component } from 'react';
import { render } from 'react-dom';
import Bottom from './index/bottom';
import Bodys from './index/bodys';
import Top from './index/top';
import CountStore from '../store/countStore';
const CountStores = new CountStore();
var arr=[1,2,3,4];
var arrs=[{
a:"d"
},
{
a:"b"
}]
class Index extends Component {
constructor(props){
super(props);
}
render(){
return <div id="index">
<div>123132</div>
<Top id="top" kkk={arr} dataid={arrs}></Top>
<Bodys id="bodys" countstore="{CountStores}">744855</Bodys>
<Bottom id="bottom">213213</Bottom>
</div>
}
}
export default Index;
报错截图
package.json
.babelrc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在webpack上加上预编译就不会报错,加在babelrc上却不行,不知道什么原因