arcthur / react-book-examples

深入 React 技术栈一书中示例

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

大神,我写到了250页,看不到你效果图上`loading`.

jiexishede opened this issue · comments

** 改动 代码 ** ,变成这个样子.

loading 依然,没有加载出来啊.

P 标签,

loading

没有展示出来.

 case LOAD_ARTICLES: {
      return {
        ...state,
        loading: true,
        error: false,
      };
    }

    case LOAD_ARTICLES_SUCCESS: {
      return {
        ...state,
        loading: true,
        error: false,
        articleList: action.payload,
      };
    }

    case LOAD_ARTICLES_ERROR: {
      return {
        ...state,
        loading: false,
        error: true,
      };
    }

    default:
      return state;
  }



image

没有 loadingerror 啊,大神.

@connect(state => {
  return {
    articleList: state.home.list.articleList,
    loading: state.home.list.loading,
    error: state.home.list.error,
  };
}, {
  push,
  ...actions,
})

加上这两个就好了.

    loading: state.home.list.loading,
    error: state.home.list.error,