Skip to main content

usePowerSyncWatchedQuery()

function usePowerSyncWatchedQuery<T>(
sqlStatement,
parameters?,
options?): T[]

Type parameters

Type parameterValue
Tany

Parameters

ParameterType
sqlStatementstring
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>
}