return useQuery({
queryKey: ['auth'],
queryFn: async () => {
const response = await fetch(`url`);
return response.json();
},
refetchInterval: 300000,
select: (data) => {
return {
user: data,
};
},
});
}```
and within the component I want to do
const { data } = useAuth()
const { user } = data
but I get the error that user doesnt exist because data is undefined