Developer Hub
🔮 For applications
SDK
Data Hooks
useSportsNavigation

Hook is used for fetch lightweight sports data for navigation.

Hook represents a logic wrapper over standard Apollo's useQuery hook. Explore Apollo's docs (opens in a new tab) to understand what data the hooks return.

You can find the list of available sports here (opens in a new tab).

Usage

import { useSportsNavigation } from '@azuro-org/sdk'
 
 
const { loading, sports } = useSportsNavigation(props)
ℹ️

If the isLive state of the LiveProvider is true, the useGames hook will retrieve live games.

Props

{
  withGameCount?: boolean // adds the lightweight games data to sport for counting
}

Return Value

{ 
  loading: boolean
  error: Error | null
  sports {
    id
    slug
    name
    // if `withGameCount` props is true includes games data
    games {
      id
    }
  }
}