usePowerSyncWatchedQuery()
function usePowerSyncWatchedQuery<T>(
sqlStatement,
parameters,
options): T[]
Type Parameters
| Type Parameter | Default type |
|---|---|
T | any |
Parameters
| Parameter | Type | Default value |
|---|---|---|
sqlStatement | string | undefined |
parameters | any[] | [] |
options | Omit<SQLWatchOptions, "signal"> | {} |
Returns
T[]
Deprecated
use useQuery instead.
A hook to access the results of a watched query.
Example
export const Component = () => {
const lists = usePowerSyncWatchedQuery('SELECT * from lists');
return <View>
{lists.map((l) => (
<Text key={l.id}>{JSON.stringify(l)}</Text>
))}
</View>
}