useNavigation
The useNavigation
hook is used for fetch full sports navigation data with countries and leagues.
ℹ️
Hook represents a logic wrapper over TanStack Query's useQuery
hook. Explore TanStack Query docs (opens in a new tab) to understand what data the hook returns.
Usage
import { useNavigation } from '@azuro-org/sdk'
const { data, isFetching, error } = useNavigation(props)
Props
{
filter?: {
sportHub?: SportHub
sportIds?: Array<string | number>
}
isLive?: boolean // if `true`, the hook will retrieve live navigation
query?: QueryParameter<NavigationQuery['sports']>
}
enum SportHub {
Sports = 'sports',
Esports = 'esports',
Unique = 'unique'
}
Return Value
UseQueryResult<NavigationQuery['sports']>
import { type UseQueryResult } from '@tanstack/react-query'
type NavigationQuery = {
__typename?: 'Query'
sports: Array<{
__typename?: 'Sport'
id: string
slug: string
name: string
sportId: string
activeGamesCount: number
activeLiveGamesCount: number
activePrematchGamesCount: number
sporthub: {
__typename?: 'SportHub'
id: string
slug: string
}
countries: Array<{
__typename?: 'Country'
id: string
slug: string
name: string
turnover: string
activeGamesCount: number
activeLiveGamesCount: number
activePrematchGamesCount: number
leagues: Array<{
__typename?: 'League'
id: string
slug: string
name: string
turnover: string
activeGamesCount: number
activeLiveGamesCount: number
activePrematchGamesCount: number
}>
}>
}>
}