# Function useFetch

useFetch<TData, TError>(...args): UseQueryResult< TData, TError >

React hook that allows to make authorized fetch request to any Sisense API.

# Type parameters

Parameter Default
TData unknown
TError unknown

# Parameters

Parameter Type
...args [string, RequestInit, {
enabled: boolean;
requestConfig: RequestConfig;
}]

# Returns

UseQueryResult< TData, TError >

Query state that contains the status of the query execution, the result data, or the error if any occurred

# Example

 const { data, isLoading, error } = useFetch<unknown, Error>('api/v1/elasticubes/getElasticubes', {
   method: 'POST',
 });