Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 操作不能有一个未定义的";“类型”;reactjs中的属性_Javascript_Reactjs - Fatal编程技术网

Javascript 操作不能有一个未定义的";“类型”;reactjs中的属性

Javascript 操作不能有一个未定义的";“类型”;reactjs中的属性,javascript,reactjs,Javascript,Reactjs,这个错误是怎么说的?我在向redux应用商店发送请求时出错 Error: Actions may not have an undefined "type" property. Have you misspelled a constant? client/src/redux/alert/alertActions.jsx:18 15 | variant: variant 16 | } 17 | }) > 18 |

这个错误是怎么说的?我在向redux应用商店发送请求时出错

Error: Actions may not have an undefined "type" property. Have you misspelled a constant?
client/src/redux/alert/alertActions.jsx:18
  15 |             variant: variant
  16 |         }
  17 |     })
> 18 |     setTimeout(()=> dispatch(actionType(REMOVE_ALERT, {id: 1})),timeout)
  19 | }
  20 | 

很明显:您的Redux操作没有
类型
属性,或者有它,但它保存了
未定义的值
。看一下
actionType
返回的内容-一步一步地检查代码并进行调试(但如果您遇到困难,请随时返回这里)。是的,确实如此。我应该从actionType({type,payload})返回类型和负载,但是,我将action和负载作为actionType({action,payload})返回。现在解决了D:D