react报错: dispatch is not a function

react报错: dispatch is not a function,需要在类前添加@connect(() => ({}))

import {connect} from 'dva'
@connect(({ testHome }) => ({
testHome
}))
class Methods extends Component{ }

 

models文件定义

export default {
  namespace: 'testHome',
}

 

上一篇:线程安全


下一篇:Vuex学习