I'm trying to import my redux store into a non react component, so that I can dispatch some actions to it. But when I import store it just gives me this error:
"export 'store' was not found in '../../store'
And store remains undefined where I've imported it.
It's definitely there and the path is right so I can't figure out what I'm doing wrong.
I've tried what it says here and a few other things but still no luck: "export 'store' was not found in '../store'
Here's my store:
import { createStore, applyMiddleware } from "redux";
import { composeWithDevTools } from "redux-devtools-extension";
import thunk from "redux-thunk";
import rootReducer from "./reducers";
const initialState = {};
const middleware = [thunk];
const store = createStore(
rootReducer,
initialState,
composeWithDevTools(applyMiddleware(...middleware))
);
export default store;
Then I'm importing it like this:
import { store } from "../../store";