Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

looping over and creating an array in typescript

$
0
0

I am trying to loop over and create another array of the type of information that I need. However I am getting the following error:

Expected 2 arguments, but got 1.ts(2554)index.d.ts(1104, 74): An argument for 'deps' was not provided.          const analyticsTeamNames = useCallback(            (teamNames: string | null) =>            const teamNames = [];              for (let index = 0; index < selectedTeams.length; index++) {                const element = selectedTeams[index];                const team = teamsData?.find((item) => item.id === element);                teamNames.push(team?.name);              }            [teamNames],          );What exactly am I missing? 

Viewing all articles
Browse latest Browse all 6287

Trending Articles