primary-violetP
Refine2y ago
10 replies
primary-violet

Error in usecustom api call

this is the variable i'm using with my api call const { data: globalbalanceData , error, isLoading } = useCustom<{
data: IGlobalBalance;
}>({
url: ${API_URL}/globalbalance/bydate,
method: "get",
config: {
query: dateFilterQuery,
},
});


const globalbalance = globalbalanceData?.data; in the rendering i specify the following {globalbalance?.data.capital} but it fails it says globalbalance has actualy the value, but typescript doesn't give me the option to use globalbalance.capital. Where is the problem?
Was this page helpful?