javascript - ReferenceError:赋值/语法错误中的左侧无效
问题描述
我的论坛(博客)网站代码如下:
import { AUTH } from '../actionTypes/actionTypes';
import * as api from '../api';
export default signin (formData, history) = async (dispatch) => {
try {
const { data } = await api.signIn(formData);
dispatch({ type: AUTH, data });
history.push('/');
} catch (error) {
console.log(error);
}
};
但我收到此错误,第 (4) 行:
“ReferenceError:分配中的左侧无效”
如何解决?
解决方案
我通过 const 更改了默认值,并在登录后添加了“=”并且它起作用了!谢谢你们
推荐阅读
- post - 如何从 VB6 创建 HTTP POST 请求?
- scala - 如何从 AnyRef 对象中获取反映的运行时方法?
- c# - Sharepoint C# - 如何从 GetFileByServerRelativeUrl 下载文件
- hyperledger-fabric - Hyperledger Fabric 中通道内和通道之间的链码(智能合约)交互
- repeat - 循环中断时间
- mysql - 我可以将 MySql 设置为始终删除前导/尾随空格吗?
- selenium - 如何在 selenium WebDriver 中针对失败的测试用例生成电子邮件?
- python - 如何在 matplotlib 中美观地显示通用轴数?
- java - BoxLayout can't be shared 错误,试图在一个 JFrame 中容纳两个 JPanel
- vba - VBA:如何获取当前 Outlook 用户的 SMTP 电子邮件地址列表?