Now I am trying basic redux logic in Stackblitz platform.
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import { composeWithDevTools } from 'redux-devtools-extension';
import taskReducer from './reducers/taskReducer';
const store = createStore(
taskReducer,
composeWithDevTools(applyMiddleware(thunk))
);
export default store;
But when I add this code into src/store.js, the preview panel just shows blank page. And just when change this file not to use createStore or thunk, that works fine.. I am mostly sure this code is right, and I think this is just stackblitz issue.
So I want to know why this happening
Thanks for your help, community..
I am just trying now, and I hope to stackblitz works fine.
In
readux-thunk@3there is no longer anydefaultexport, so withimport thunk from "redux-thunk"thunkis undefined.Compare v2
to v3
Update your code to import the named
thunkexport.