Redux store not connected

前端 未结 2 1496
慢半拍i
慢半拍i 2021-01-29 05:36

I am developing a Reactjs web application from scratch and encountered a tricky situation which i need help with. Whenever i navigate away from a particular url and navigate bac

相关标签:
2条回答
  • 2021-01-29 06:13

    @AKJ - @Andy Ray said it correctly, but I'll like to add that componentDidMount is the best place to load async calls, as it is called after render and about Store redux store keeps data until you refresh the page after refresh redux store is reinitialized, if you need store the data after refresh try redux-persist

    0 讨论(0)
  • 2021-01-29 06:26

    You only call loadAAA at the top level of index.js, which only executes once when your page loads. If you want to dispatch it every time your XYZPage page renders, put in XYZ's componentDidMount

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