Element type is invalid: expected a string (for built-in components) or a class/function

后端 未结 9 586
谎友^
谎友^ 2020-12-03 21:11
import React from \'react\';
import ReactDOM from \'react-dom\';
import Map from \'./components/map/container/map\';
import App from \'./App\';
import \'./index.css\         


        
9条回答
  •  鱼传尺愫
    2020-12-03 21:25

    For me, I faced this issue when I forget to use react-redux's connect in my export.

    So,

    changing:

     export default(mapStateToProps, mapDispatchToProps)(ContentTile);
    

    To:

    export default connect(mapStateToProps, mapDispatchToProps)(ContentTile);
    

    solved the issue. Really silly mistake

提交回复
热议问题