You must pass a component to the function returned by connect. Instead received undefined

前端 未结 5 708
忘掉有多难
忘掉有多难 2021-01-01 11:37

The code below gives

Uncaught Error: You must pass a component to the function returned by connect. Instead received undefined

5条回答
  •  北荒
    北荒 (楼主)
    2021-01-01 12:19

    You are doing import PostList from '../components/PostList'; so you need to use export default in your PostList.js file.

    Otherwise you need to do import { PostList } from '../components/PostList';.

    To whoever is interested, here is a nice article about es6 import/export syntax: http://www.2ality.com/2014/09/es6-modules-final.html

提交回复
热议问题