Javascript 操作不能有一个未定义的";“类型”;reactjs中的属性
这个错误是怎么说的?我在向redux应用商店发送请求时出错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 |
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