Blogged Answers: React, Redux, and Context Behavior
utterances-bot opened this issue · comments
utterances bot commented
Blogged Answers: React, Redux, and Context Behavior · Mark's Dev Blog
https://blog.isquaredsoftware.com/2020/01/blogged-answers-react-redux-and-context-behavior/
kezhi wang commented
Very great article! But I got a question about the usage of the context:
In the useSelector implementation. Can we just import store instance directly?
What's the benefit of using React Context?
Thanks in advance.
Atif Qayyum commented
You have mentioned "redux uses context only to pass the Redux store instance down to child components - it doesn't pass the store state using context!"
What is the difference between the "store instance" and "store state"?
Mark Erikson commented
@aqarain :
// store instance
const store = configureStore({reducer});
// store state, aka "the latest value"
const state = store.getState()