I can get and display usernames.i just want to filter using search .Im using reactjs and firebase.
i figured it out
{athletes
.filter((athlete) => {
if (search === "") {
return athlete;
} else if (
athlete.fullName.toLowerCase().includes(search.toLowerCase())
) {
return athlete;
}
})
.map((athlete, key) => (
<AthleteCard
key={key}
athlete={athlete}
selectedAthletes={athletesForm}
updateAthletesForm={updateAthletesForm}
/>
))}