我想知道使用includes
const haveTicketAlready = () => {
const parts = state.selectedEvent.eventParticipants;
return parts.includes(state.id);
}
其中
parts = ["recTFqe7g6Mr87QmG", "recCpqbezylDb6P0O"]
和state.id = "recCpqbezylDb6P0O"
给出错误Argument of type 'string' is not assignable to parameter of type 'never'.ts(2345)
state
具有界面
state: {
id: string;
authState: boolean;
uid: string;
displayName: string;
photoURL: string;
selectedEvent: {
title: string;
description: string;
cost: string;
eventParticipants: [];
};
}