Skip to content

Commit

Permalink
export fix
Browse files Browse the repository at this point in the history
Persistor should be exported, not persistStore. But the whole line 'export default {store, persistor} ' is uneccessary due to the above already exported store and persistor (even though its mentioned in video that they are not needed). But if you remove them, the 'export default' doesnt work. According to react it is better to use export default only if there is single export. (in this case we have 2 -> store and persistor). It should be exported like this, without export default
  • Loading branch information
SagiSan authored Dec 24, 2019
1 parent daa484d commit 86e6cf9
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/redux/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ const middlewares = [logger];
export const store = createStore(rootReducer, applyMiddleware(...middlewares));

export const persistor = persistStore(store);

export default { store, persistStore };

1 comment on commit 86e6cf9

@ignatius22
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, helpful

Please sign in to comment.