![](/img/trans.png)
[英]React App Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`. Error Message
[英]How to fix “Unexpected block statement surrounding arrow body; move the returned value immediately after the =>” ESLint error?
我收到此錯誤
Unexpected block statement surrounding arrow body; move the returned value immediately after the =>"
對於下面的代碼:
let guestBeingEdited = SJ.Event.ListItem.previouslyAddedGuests.filter(
guest => {
return guest.id === SJ.Event.ListItem.selectPrevGuest;
},
);
我從這里嘗試了不同的建議,但無法解決。 有什么建議么?
塊體和返回語句是不必要的。 它要求您將代碼更改為:
let guestBeingEdited = SJ.Event.ListItem.previouslyAddedGuests.filter(
guest => guest.id === SJ.Event.ListItem.selectPrevGuest
);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.