From fe2cf178458637c2d5b8577c899db40f2e4fbd77 Mon Sep 17 00:00:00 2001 From: Jerel Miller Date: Mon, 27 Nov 2023 18:07:54 -0700 Subject: [PATCH] Minor tweak to error message for loadQuery function --- src/react/hooks/__tests__/useLoadableQuery.test.tsx | 4 ++-- src/react/hooks/useLoadableQuery.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/react/hooks/__tests__/useLoadableQuery.test.tsx b/src/react/hooks/__tests__/useLoadableQuery.test.tsx index 73eeaabf373..d89cb5073d8 100644 --- a/src/react/hooks/__tests__/useLoadableQuery.test.tsx +++ b/src/react/hooks/__tests__/useLoadableQuery.test.tsx @@ -4286,7 +4286,7 @@ it("throws when calling loadQuery on first render", async () => { expect(() => renderWithMocks(, { mocks })).toThrow( new InvariantError( - "useLoadableQuery: loadQuery should not be called during render. To load a query during render, use `useBackgroundQuery`." + "useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook." ) ); }); @@ -4319,7 +4319,7 @@ it("throws when calling loadQuery on subsequent render", async () => { expect(error).toEqual( new InvariantError( - "useLoadableQuery: loadQuery should not be called during render. To load a query during render, use `useBackgroundQuery`." + "useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook." ) ); }); diff --git a/src/react/hooks/useLoadableQuery.ts b/src/react/hooks/useLoadableQuery.ts index e8f492d96da..b873a4ba33a 100644 --- a/src/react/hooks/useLoadableQuery.ts +++ b/src/react/hooks/useLoadableQuery.ts @@ -183,7 +183,7 @@ export function useLoadableQuery< failDuringRender(() => { invariant( false, - "useLoadableQuery: loadQuery should not be called during render. To load a query during render, use `useBackgroundQuery`." + "useLoadableQuery: 'loadQuery' should not be called during render. To start a query during render, use the 'useBackgroundQuery' hook." ); });