• Preparing search index...
  • The search index is not available
@boostxyz/reward-kit-react
  • @boostxyz/reward-kit-react
  • useReward

Function useReward

  • useReward(): RewardContextValue

    Hook to access reward data from the RewardContext. For more information on UseQueryResult, see https://tanstack.com/query/v4/docs/framework/react/reference/useQuery

    Returns RewardContextValue

    The reward query result

    Throws

    Error if used outside of a RewardProvider

    Example

    function RewardDisplay() {
    const { data, isLoading } = useReward();

    if (isLoading) return <div>Loading...</div>;
    return <div>Reward Amount: {data?.boost.incentives[0]?.rewardAmount}</div>;
    }
    • Defined in packages/react/src/Reward.tsx:50

Settings

Member Visibility
@boostxyz/reward-kit-react
  • Loading...

Generated using TypeDoc