TypeError: Found non-callable @@iterator
const middelware ={thunk};
const Store = createStore(
rootReducer,initialState, compose(
applyMiddleware(...middelware),
window.devToolsExtension ? window.devToolsExtension() : f=> f
const middelware ={thunk};
const Store = createStore(
rootReducer,initialState, compose(
applyMiddleware(...middelware),
window.devToolsExtension ? window.devToolsExtension() : f=> f
TypeError: Found non-callable @@iterator
const middelware ={thunk};
const Store = createStore(
rootReducer,initialState, compose(
applyMiddleware(...middelware),
window.devToolsExtension ? window.devToolsExtension() : f=> f
const middelware ={thunk};
const Store = createStore(
rootReducer,initialState, compose(
applyMiddleware(...middelware),
window.devToolsExtension ? window.devToolsExtension() : f=> f
Share
Improve this question
edited Jan 15, 2020 at 16:55
Kevin Beal
10.8k13 gold badges70 silver badges93 bronze badges
asked Oct 25, 2019 at 5:07
Hari MohanHari Mohan
1011 gold badge2 silver badges7 bronze badges
1
- This has nothing to do with React or Redux. – Kevin Beal Commented Jan 15, 2020 at 16:56
2 Answers
Reset to default 15Presumably middleware
is an object and not an array, so here or somewhere else, you are doing the equivalent of this:
applyMiddleware(...{})
rather than:
applyMiddleware(...[])
Spreading arguments in function calls can only be done with arrays or other similar iterable objects.
Enhancing Kevin Beal answer,
You can use:
applyMiddleware(...Object.values(middleware))