Skip to content

Commit

Permalink
Removed conditional hook.
Browse files Browse the repository at this point in the history
  • Loading branch information
Chriztiaan committed Oct 4, 2024
1 parent 65d37b9 commit deb2e6f
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions packages/tanstack-react-query/src/hooks/useQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ function useQueryCore<
queryClient: Tanstack.QueryClient,
useQueryFn: (options: TQueryOptions, queryClient?: Tanstack.QueryClient) => TQueryResult
): TQueryResult {
const { query, parameters, ...resolvedOptions } = options;

if (!query) {
return useQueryFn(
{
...resolvedOptions
} as TQueryOptions,
queryClient
);
}
const powerSync = usePowerSync();

if (!powerSync) {
Expand All @@ -77,6 +67,7 @@ function useQueryCore<

const [error, setError] = React.useState<Error | null>(null);
const [tables, setTables] = React.useState<string[]>([]);
const { query, parameters, ...resolvedOptions } = options;

React.useEffect(() => {
if (error) {
Expand Down

0 comments on commit deb2e6f

Please sign in to comment.