react-native - 删除 eslint error '解析错误:意外的令牌,预期的;(致命)'在反应本机代码中
问题描述
我在 react-native 中做一些代码并在我的代码中收到此错误“解析错误:意外令牌,预期“;”(致命)”
index.js
export const emailChanged = (text) => {
rerutn { ///getting error at this line//
type: EMAIL_CHANGED,
payload: text
};
};
.eslintrc
{
"extends": "rallycoding",
"rules": {
"arrow-body-style": 1
}
}
解决方案
它必须return
代替rerutn
. 所以你的代码看起来像这样:
export const emailChanged = (text) => {
return {
type: EMAIL_CHANGED,
payload: text
};
};
推荐阅读
- javascript - 引导程序中的轮播
- sql - 在 SQL Server 中的 IN 和 JOIN 运算符之间最好使用哪个值列表作为表 2?
- javascript - 带有对象数组的 IE11 探测器(适用于 Firefox 和 Chrome)
- javascript - 如何将选择的日期选择器值从第一页显示到第二页日期选择器
- java - 如何使用 Android Jetpack Navigation 显示自定义 DialogFragment?
- html - 在第二个 div 上给出边框底部
- python - Python 包结构:如何导入自动生成的 proto buf 类
- android-gradle-plugin - 任务:transformClassesAndResourcesWithR8ForRelease FAILED 程序类型已经存在 *.BuildConfig
- apache-camel - Wildfly ActiveMQ 警告:在地址“队列名称”上开始分页;当前大小为:10,504,042 字节;最大大小字节:10,485,760
- swift - 如何使用组合来分配从核心数据获取请求返回的元素数量?