reactjs - TypeError: Invalid attempt to destructure non-iterable instance -


i'm new in project , i'm trying use react-redux-universal-hot-example api, using code:

export function showmessage() {   return {     type: show_message,     promise: (client) => client.get('/posts')   }; } 

i error in browser:

typeerror: invalid attempt destructure non-iterable instance

can help?

i faced same issue , looking found typo. should use types instead of type i.e:

export function showmessage() {   return {     types: [message_fetch, message_fetch_success, message_fetch_fail],     promise: (client) => client.get('/post')   } } 

bear in mind array of 'types' dispatch action(success or fail) when promise resolved.


Comments