Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Actions may not have an undefined "type" property. Have you misspelled a constant? [closed]

Tags:

reactjs

redux

My demo does not run well.

https://github.com/jiexishede/react-redux-demo01

The error is :

enter image description here

I don't know how to solve this error. The error stops me more than two hours. I have to ask someone help me.

like image 490
jiexishede Avatar asked Mar 12 '17 15:03

jiexishede


1 Answers

Your action below does not contain a type property which is required

export function loadArticles() {   return {     types:[LOAD_ARTICLES, LOAD_ARTICLES_SUCCESS, LOAD_ARTICLES_ERROR],     url:'./api/articles.json',   }; } 

You should modify the above code so that your action creator returns a type

export function loadArticles() {   return {     type: LOAD_ARTICLES,     url:'./api/articles.json',   }; } 
like image 79
Deividas Karzinauskas Avatar answered Sep 20 '22 10:09

Deividas Karzinauskas