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

前端 未结 5 704
忘掉有多难
忘掉有多难 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:37

    Not related to the asker specifically, but if you're facing this error, it's worth to check if you have the connect() syntax right:

    const PreloadConnect = connect(mapStateToProps, {})(Preload);
    
    export default PreloadConnect;
    

    Note that Preload, is passed as a IIFE parameter.

提交回复
热议问题