diff --git a/.changeset/legal-yaks-tell.md b/.changeset/legal-yaks-tell.md new file mode 100644 index 0000000..57dd8e6 --- /dev/null +++ b/.changeset/legal-yaks-tell.md @@ -0,0 +1,5 @@ +--- +"@macalinao/grill": patch +--- + +fix error message for using context in wrong spot diff --git a/packages/grill/src/contexts/grill-context.ts b/packages/grill/src/contexts/grill-context.ts index 7ec9e54..706de7d 100644 --- a/packages/grill/src/contexts/grill-context.ts +++ b/packages/grill/src/contexts/grill-context.ts @@ -14,6 +14,11 @@ import { createContext, useContext } from "react"; export interface GrillContextValue { /** DataLoader instance for batching and caching Solana account requests */ accountLoader: DataLoader; + /** + * Refetches the given accounts. + * @param addresses + * @returns + */ refetchAccounts: (addresses: Address[]) => Promise; /** @@ -50,9 +55,7 @@ export const GrillContext: React.Context = export const useGrillContext = (): GrillContextValue => { const context = useContext(GrillContext); if (!context) { - throw new Error( - "useSolanaAccountContext must be used within a SolanaAccountProvider", - ); + throw new Error("useGrillContext must be used within a GrillProvider"); } return context; };