用了immutable找不到值求助

#1

我是用echarts插件,没用immutable是可以的,但看echarts的option层级太深,所以改为immutable。
把initialState改成immutable的,在connect改回原生对象,我debugger了这个函数能获取到数据。但到了componentWillReceiveProps就变成undefined了。这是为什么啊?

const mapStateToProps = (state)=>{
    debugger;
    console.log(state.toJS());
    return state.toJS();
}
componentWillReceiveProps(){
  debugger
//里面获取值变成了undefined
}
#2

Redux 不支持 immutable data? 不熟悉 Redux…

#3

支持的,只是我没找到出错的原因

#4

import { connect } from ‘react-redux’;

#5
const mapStateToProps = store => {
      return{
          store
      }
}
connect(mapStateToProps)(ComponentXXX)

connect 的参数 返回格式 改一下!估计就可以了~~~~~~~~~~~~