I have a next app with next-redux-wrapper and my store code
import { createStore, applyMiddleware } from "redux";
import reducer from "./reducers";
import reduxThunk from "redux-thunk";
export default (initialState = undefined, { storeKey = "app" }) => {
return createStore(reducer, initialState, applyMiddleware(reduxThunk));
};
I am importing the store and export app withRedux next-redux-wrapper
All things works fine but I want to access the store from non component files
import store from "../redux/store";
export const lang = store(undefined, { storeKey: "app" }).getState().user
.language;
lang not changed when I change it in main store