useQuery()
function useQuery<T>(
query,
parameters?,
options?): QueryResult<T>
A hook to access the results of a watched query.
Type parameters
Type parameter | Value |
---|---|
T | any |
Parameters
Parameter | Type |
---|---|
query | string | CompilableQuery <T > |
parameters ? | any [] |
options ? | AdditionalOptions |
Returns
QueryResult
<T
>
Example
export const Component = () => {
const { data: lists } = useQuery('SELECT * from lists');
return <View>
{lists.map((l) => (
<Text key={l.id}>{JSON.stringify(l)}</Text>
))}
</View>
}