We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d62f367 commit c5a9eb5Copy full SHA for c5a9eb5
packages/react/src/hooks/useQuery.ts
@@ -39,7 +39,7 @@ export type QueryResult<T> = {
39
export const useQuery = <T = any>(
40
sqlStatement: string,
41
parameters: any[] = [],
42
- options: AdditionalOptions = {}
+ options: AdditionalOptions = { runQueryOnce: false }
43
): QueryResult<T> => {
44
const powerSync = usePowerSync();
45
if (!powerSync) {
@@ -96,7 +96,7 @@ export const useQuery = <T = any>(
96
await fetchTables();
97
await fetchData();
98
})();
99
- }, []);
+ }, [powerSync, memoizedParams, sqlStatement]);
100
101
React.useEffect(() => {
102
// Abort any previous watches
0 commit comments