首页 > 其他 > 详细

Error: Actions must be plain objects. Use custom middleware for async actions.

时间:2021-02-09 22:18:49      阅读:30      评论:0      收藏:0      [点我收藏+]

原本代码:

import { SREACH_FOCUS, SREACH_BLUR } from "./actionType"
export const searchFocus = () => { 
    type: SREACH_FOCUS
}
export const search_blur = () => { 
    type: SREACH_BLUR
}

改正后:

import { SREACH_FOCUS, SREACH_BLUR } from "./actionType"
export const searchFocus = () => ({
    type: SREACH_FOCUS
})
export const search_blur = () => ({
    type: SREACH_BLUR
})

区别

=>{}和=>({})

原因

Error: Actions must be plain objects. Use custom middleware for async actions.

原文:https://www.cnblogs.com/lceihen/p/14393640.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!