How to access Redux store outside a component?

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;

Made in India with ❤️ by Rajesh Kumar Yadav

Twitter