The last overload gave the following error. Argument of type '{ queryKey: string[]; queryFn: Promise<GetReferralCode>; }' is not assignable to parameter of type 'QueryKey'. Object literal may only specify known properties, and 'queryKey' does not exist in type 'readonly unknown[]'. 6 | const useCheckReferralCode = (code: string) => {
import { useQuery } from '@tanstack/react-query';
import KStadiumAPI from 'apis/kstadiumAPI';
import { CHECK_REFERRAL_CODE_KEY } from 'query/keys';
const useCheckReferralCode = (code: string) => {
const result = useQuery({
queryKey: [CHECK_REFERRAL_CODE_KEY, code],
queryFn: () => KStadiumAPI.fetchReferralCode(code),
});
return result.data;
};
export default useCheckReferralCode;