bradtraversy / mern_shopping_list

Shopping List built with MERN and Redux
605 stars 437 forks source link

After deployment app doesn't work without Redux Chrome DevTools #20

Open auziak opened 4 years ago

auziak commented 4 years ago

Code in store.js should be changed to this:

const initialState = {};

const middleware = [thunk];

const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

const enhancer = composeEnhancers(applyMiddleware(...middleware));

const store = createStore( rootReducer, initialState, enhancer );

Solution links: https://github.com/zalmoxisus/redux-devtools-extension/issues/320 https://github.com/zalmoxisus/redux-devtools-extension#12-advanced-store-setup

MarcLignarius commented 4 years ago

Thanks for this!

Tuan96 commented 4 years ago

@auziak Thanks. Only 1 small typo on the word "middleware". It should be "middleWare". const enhancer = composeEnhancers(applyMiddleware(...middleWare));