Skip to content

Commit

Permalink
Minor tweak to error message for loadQuery function
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Nov 28, 2023
1 parent 51d6e92 commit fe2cf17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/react/hooks/__tests__/useLoadableQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4286,7 +4286,7 @@ it("throws when calling loadQuery on first render", async () => {

expect(() => renderWithMocks(<App />, { 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."
)
);
});
Expand Down Expand Up @@ -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."
)
);
});
Expand Down
2 changes: 1 addition & 1 deletion src/react/hooks/useLoadableQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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."
);
});

Expand Down

0 comments on commit fe2cf17

Please sign in to comment.