How to access redux store outside a react component?

Technology Community › Category: Redux › How to access redux store outside a react component?
VietMX Staff asked 5 years ago

Yes.You just need to export the store from the module where it created with createStore. Also, it shouldn’t pollute the global window object

store = createStore(myReducer);
export default store;