Skip to content

Commit 1c5f1ad

Browse files
Add powerSync to dependency array
1 parent f86bca6 commit 1c5f1ad

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/react/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const Component = () => {
6969

7070
## Reactive Queries
7171

72-
The `useQuery` hook allows you to access the results of a watched query. Queries will automatically update when a dependant table is updated unless you set the `runQueryOnce` flag. You are also able to use a compilable query (e.g. [Kysely queries](https://github.com/powersync-ja/powersync-js/tree/main/packages/kysely-driver)) as a query argument in place of a SQL statement string.
72+
The `useQuery` hook allows you to access the results of a watched query. Queries will automatically update when a dependent table is updated unless you set the `runQueryOnce` flag. You are also able to use a compilable query (e.g. [Kysely queries](https://github.com/powersync-ja/powersync-js/tree/main/packages/kysely-driver)) as a query argument in place of a SQL statement string.
7373

7474
```JSX
7575
// TodoListDisplay.jsx
@@ -305,7 +305,7 @@ function MyWidget() {
305305
// - It will rerender on any state change of the watched query. E.g. if isFetching alternates
306306
// If MyWatchedWidget is memoized
307307
// - It will re-render if the data reference changes. By default the data reference changes after any
308-
// change to the query's dependant tables. This can be optimized by using Incremental queries.
308+
// change to the query's dependent tables. This can be optimized by using Incremental queries.
309309
<MyWatchedWidget watchedResult={data}>
310310
)
311311
}

packages/react/src/hooks/watched/watch-utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const constructCompatibleQuery = <RowType>(
6767
execute: () => query.execute()
6868
};
6969
}
70-
}, [query]);
70+
}, [query, powerSync]);
7171

7272
const queryChanged = checkQueryChanged(parsedQuery, options);
7373

0 commit comments

Comments
 (0)