This expression is not callable
Hello i get this error on the get session hook.
My hook:
export function useUserSession() {
console.log(authClient);
const {
data: session,
isPending, //loading state
error, //error object
refetch, //refetch the session
} = authClient.session(); <--- thsi creates the error. Apperamtly session deos not exist on type...
return { session, isPending, error, refetch };
}
The error on
Property 'session' does not exist on type '{ admin: { setRole: <FetchOptions extends { method?: string | undefined; headers?: (HeadersInit & (HeadersInit | CommonHeaders)) | undefined; cache?: RequestCache | undefined; ... 31 more ...; disableValidation?: boolean | undefined; }>(data_0: Prettify<...>, data_1?: FetchOptions | undefined) => Promise<...>; }; } ...'.ts(2339)
Iam not sure why this doesnt work, i would really appreciate if someone knows what iam doing wronghere
.

1 Reply
It's
useSession