原本代码:

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.的更多相关文章

  1. 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 ...

  2. 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 ...

  3. [转]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 ...

  4. [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 ...

  5. [译]Writing Custom Middleware in ASP.NET Core 1.0

    原文: https://www.exceptionnotfound.net/writing-custom-middleware-in-asp-net-core-1-0/ Middleware是ASP. ...

  6. 通过Redux源码学习基础概念一:简单例子入门

    最近公司有个项目使用react+redux来做前端部分的实现,正好有机会学习一下redux,也和小伙伴们分享一下学习的经验. 首先声明一下,这篇文章讲的是Redux的基本概念和实现,不包括react- ...

  7. react-redux源码解析

    有理解不对的地方,欢迎大家指正!!! react为什么需要redux辅助???react是view层的单向数据流框架,数据需要一层一层往子组件传递(子组件并不会自动继承).子组件需要操作父组件的数据时 ...

  8. 正式学习React(四) 前序篇

    预热 redux 函数内部包含了大量柯里化函数以及代码组合思想 柯里化函数(curry) 通俗的来讲,可以用一句话概括柯里化函数:返回函数的函数 // example const funcA = (a ...

  9. Redux源码分析之createStore

    接着前面的,我们继续,打开createStore.js, 直接看最后, createStore返回的就是一个带着5个方法的对象. return { dispatch, subscribe, getSt ...

随机推荐

  1. Spark剖析-宽依赖与窄依赖、基于yarn的两种提交模式、sparkcontext原理剖析

    Spark剖析-宽依赖与窄依赖.基于yarn的两种提交模式.sparkcontext原理剖析 一.宽依赖与窄依赖 二.基于yarn的两种提交模式深度剖析 2.1 Standalne-client 2. ...

  2. 设计模式c++(1)

    本来是想把之前的<head first设计模式>看了,不过因为这本书是java实现的,跟c++还是略有区别. 于是找了一下,发现了一个不错的blog,打算连书带blog一起参考着看了. b ...

  3. windows提权常用系统漏洞与补丁编号速查对照表

    #Security Bulletin #KB #Description #Operating System CVE-2020-0787 [Windows Background Intelligent ...

  4. CentOS 安装TFTP

    1.当然是使用yum安装最直接,一共会安装3个东东tftp.i386tftp-server.i386xinetd.i386[root@localhost CentOS]# yum -y install ...

  5. UML实战总结——机房收费系统UML第一版部分图展

    距离机房收费系统已经过去了近2个月之久,如今的UML图才出来,从软件开发设计的逻辑上来讲这是顺序有问题的,不过,对于我们而言,而且是初次用面向对象的思想去设计和建模,就当是UML的一个实战练手的项目吧 ...

  6. EIGRP和OSPF__EIGRP

    EIGRP解释 1.Enhanced Interior Gateway Routing Protocol 即增强内部网关路由协议.EIGRP同内部网关路由选择协议(IGRP)一样,是Cisco公司的私 ...

  7. Codeforces Round #651 (Div. 2) A. Maximum GCD(数论)

    题目链接:https://codeforces.com/contest/1370/problem/A 题意 有 $n$ 个数大小分别为 $1$ 到 $n$,找出两个数间最大的 $gcd$ . 题解 若 ...

  8. codeforces626D . Jerry's Protest (概率)

    Andrew and Jerry are playing a game with Harry as the scorekeeper. The game consists of three rounds ...

  9. Baby-step giant-step算法

    写在前面: 学习笔记,方便复习,学习资料来自网络,注明出处 我们都在努力奔跑,我们都是追梦人 结论 In group theory, a branch of mathematics, the baby ...

  10. Codeforces Round #687 (Div. 2, based on Technocup 2021 Elimination Round 2) C. Bouncing Ball (后缀和,枚举)

    题意:有一长度为\(n\)的平台,平台有的位置有木桩,可以使小球弹起来,小球必须从第\(p\)个位置开始,而且每次都会向右弹\(k\)个单位,然后有的位置是没有木桩的,你可以在这些的空的位置放一个木桩 ...