Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Found non-callable @@iterator in reactjs store

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
like image 802
Hari Mohan Avatar asked Oct 25 '19 05:10

Hari Mohan


1 Answers

Presumably 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.

like image 93
Kevin Beal Avatar answered Nov 14 '22 21:11

Kevin Beal