Connected component not receiving store props n Redux

前端 未结 2 1766
感情败类
感情败类 2021-01-19 17:51

I was doing a bit of refactoring and tried connecting a higher level component to redux using connect() but the component I\'m connecting keeps giving me empty

相关标签:
2条回答
  • 2021-01-19 17:59

    The reason your props in Login component are empty is because you are not actually using the connected Login container, As you have mentions its in containers/login

    So in your App.js change the import of login from ./presentation/login to

    import Login from '/path/to/containers/Login';

    0 讨论(0)
  • 2021-01-19 18:13

    You have imported presentation component in your app.js rather than container component. Please import your container component like below

    import Login from './containers/login.js';
    

    This will solve the problem as per my understanding from your code

    0 讨论(0)
提交回复
热议问题