score:2

Accepted answer

You can simply filter data into a new array and render component basing on this array. Something like this:

const { data:projects, error } = useSWR(
    ['api/projects', API_KEY],
    fetcher
);
if(error) return (<ErrorScreen />);
if(!data) return (<Loading />);
let availableProjects = projects.filter(p => availabilityChecker(p.location));
return (
    availableProjects.map(p => (<Project key={p.id} project={p} />));
);

Related Query

More Query from same tag