Immutable.js不呈现列表数据

时间:2018-05-08 16:49:55

标签: reactjs redux react-redux redux-thunk redux-saga

我的减速机看起来像这样:

startActivity(Intent)

这就是我的组件的样子:

import { fromJS } from 'immutable';
const GET_LIST = 'GET_LIST';

const initialState = fromJS({
  list: [{
         ID: 1
  },
  {
    ID: 2
}]
});

function reducer(state = initialState, action) {
  switch (action.type) {
    case GET_LIST:
      return state
        .set('list', action.payload);
    default:
      return state;
  }
}
export default reducer;

问题是:我正在尝试遍历'this.props.list',但它不会在我的html页面中呈现数据。但是当我尝试console.log列表时,它在浏览器控制台中显示数据,但数据不会在html页面中呈现。我想在页面中显示initialState数据。

这是它在控制台中的显示方式: enter image description here

请有人为此解决问题。我希望大家都明白这个问题。

0 个答案:

没有答案