我正在用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
}
}
答案 0 :(得分:1)
它必须是return
而不是rerutn
。因此您的代码将如下所示:
export const emailChanged = (text) => {
return {
type: EMAIL_CHANGED,
payload: text
};
};