Hook to access reward data from the RewardContext. For more information on UseQueryResult, see https://tanstack.com/query/v4/docs/framework/react/reference/useQuery
UseQueryResult
The reward query result
Error if used outside of a RewardProvider
function RewardDisplay() { const { data, isLoading } = useReward(); if (isLoading) return <div>Loading...</div>; return <div>Reward Amount: {data?.boost.incentives[0]?.rewardAmount}</div>;} Copy
function RewardDisplay() { const { data, isLoading } = useReward(); if (isLoading) return <div>Loading...</div>; return <div>Reward Amount: {data?.boost.incentives[0]?.rewardAmount}</div>;}
Hook to access reward data from the RewardContext. For more information on
UseQueryResult
, see https://tanstack.com/query/v4/docs/framework/react/reference/useQuery