Invariant Violation : Invalid Hooks Call. Hooks Call can only be made inside body of function components

前端 未结 1 1913
孤独总比滥情好
孤独总比滥情好 2020-12-22 11:51

Hi am getting this error at Connect() function in LoginScreen.js. On commenting it its working fine. I am guessing either my Store is not properly setup or i am not able to

相关标签:
1条回答
  • 2020-12-22 12:24

    React-redux (> 7.0.1) uses hook & React-native (< 0.59) doesn’t support Hooks yet.

    You can run npm ls react-native in your application folder to check which version you’re using.

    If you find more than one of them, this might also create problems. more on it

    There are two solution

    Upgrade the react native version to 0.59.0

    OR

    Downgrade the react redux version to 6.0.1

    I hope it help you.

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