Error: Actions must be plain objects. Use custom middleware for async actions.
原本代码:
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.的更多相关文章
- Android Studio: Error:Cannot locate factory for objects of type DefaultGradleConnector, as ConnectorServiceRegistry
将别人的项目导入自己的环境下出现的问题. Gradle refresh failed; Error:Cannot locate factory for objects of type DefaultG ...
- Error: [mobx] Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended.
1.Error: [mobx] Since strict-mode is enabled, changing observed observable values outside actions is ...
- [转]Writing Custom Middleware in ASP.NET Core 1.0
本文转自:https://www.exceptionnotfound.net/writing-custom-middleware-in-asp-net-core-1-0/ One of the new ...
- [React + Functional Programming ADT] Create Redux Middleware to Dispatch Actions with the Async ADT
We would like the ability to group a series of actions to be dispatched with single dispatching func ...
- [译]Writing Custom Middleware in ASP.NET Core 1.0
原文: https://www.exceptionnotfound.net/writing-custom-middleware-in-asp-net-core-1-0/ Middleware是ASP. ...
- 通过Redux源码学习基础概念一:简单例子入门
最近公司有个项目使用react+redux来做前端部分的实现,正好有机会学习一下redux,也和小伙伴们分享一下学习的经验. 首先声明一下,这篇文章讲的是Redux的基本概念和实现,不包括react- ...
- react-redux源码解析
有理解不对的地方,欢迎大家指正!!! react为什么需要redux辅助???react是view层的单向数据流框架,数据需要一层一层往子组件传递(子组件并不会自动继承).子组件需要操作父组件的数据时 ...
- 正式学习React(四) 前序篇
预热 redux 函数内部包含了大量柯里化函数以及代码组合思想 柯里化函数(curry) 通俗的来讲,可以用一句话概括柯里化函数:返回函数的函数 // example const funcA = (a ...
- Redux源码分析之createStore
接着前面的,我们继续,打开createStore.js, 直接看最后, createStore返回的就是一个带着5个方法的对象. return { dispatch, subscribe, getSt ...
随机推荐
- java调用shell脚本执行操作
//定时清空 日志 String shellString = "sh /home/jyapp/delete_log.sh"; Process process = Runtime.g ...
- springboot基础配置-->Properties配置
Spring Boot项目中的application.properties配置文件一共可以出现在如下4个位置: 项目根目录下的config文件夹中. 项目根目录下. classpath下的config ...
- 基于Qt的tcp客户端和服务器实现摄像头帧数据处理(客户端部分)
项目简述 实现客户端调用摄像头,并以帧的形式将每一帧传输到服务端,服务端将图片进行某些处理后再返回给客户端.(客户端与服务端通信代码部分参考<Qt5 开发及实例>) 项目步骤 客户端的编写 ...
- MapReduce参数调优
原文链接:http://blog.javachen.com/2014/06/24/tuning-in-mapreduce/ 本文主要记录Hadoop 2.x版本中MapReduce参数调优,不涉及Ya ...
- H - Oil Skimming (挖石油)
题意大概是,海上漂浮着一些符号为#的石油,你要去搜集他们,但是你的勺子呢能且只能挖到两个单元的石油.问你最多能挖多少勺.注意 不能挖到纯净的海水,不然石油会被纯净的海水稀释的. 二分匹配,计算出里边有 ...
- Redundant Paths POJ - 3177 把原图变成边—双连通图
无向图概念:(这里的x->y表示x和y之间有一条无向边)1.桥:对于一个无向图,如果删除某条边后,该图的连通分量增加,则称这条边为桥 比如1->2->3->4这样一个简单得图一 ...
- Python 遭遇 ProxyError 问题记录
最近遇到的一个问题,在搞清楚之后才发现这么多年的 HTTPS_PROXY 都配置错了! 起因 想用 Python 在网上下载一些图片素材,结果 requests 报错 requests.excepti ...
- Nginx基础 - 通用优化配置文件
[root@localhost ~]# vim /etc/nginx/nginx.conf user nginx; worker_processes auto; worker_cpu_affinity ...
- CodeForces - 13E(分块)
Little Petya likes to play a lot. Most of all he likes to play a game «Holes». This is a game for on ...
- redis跳表
redis使用跳表作为有序集合的底层实现之一,下面来看下跳表的结构 一.跳表的结构