删除eslint错误'解析错误:意外的令牌,应为; (致命)”在本机代码中

时间:2019-04-03 07:26:38

标签: react-native eslint

我正在用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
}
}

1 个答案:

答案 0 :(得分:1)

它必须是return而不是rerutn。因此您的代码将如下所示:

export const emailChanged = (text) => {
  return {
    type: EMAIL_CHANGED,
    payload: text
  };
};