Example: I get an array of organizations.
Using custom hook.
in the the response in the useQuery call create a interface used as a Generic<> that looks like this: organizations: Organization[].
Before we return we do this:
const organizations: Organizations[] = data?.organizations || [];
Example: I get an array of organizations. Using custom hook. in the the response in the
useQuery
call create a interface used as a Generic<> that looks like this:organizations: Organization[]
.Before we return we do this:
const organizations: Organizations[] = data?.organizations || [];
we return this: