This hook is used to fetch data from the query connected to Query Store.
When you have Query Store provider, this hook connects to it, so you'll get data driven by the store.
import {useSourceQuery} from "@use-pico/client";export const MyQueryComponent = () => { return <QueryStoreProvider values={{ filter: {name: "John"}, }} > <MyComponent/> <QueryStoreProvider/>}export const MyComponent = () => { // This will fetch data from query, using filter specified by QueryStoreProvider. const result = useSourceQuery({ store: QueryStoreProvider, });} Copy
import {useSourceQuery} from "@use-pico/client";export const MyQueryComponent = () => { return <QueryStoreProvider values={{ filter: {name: "John"}, }} > <MyComponent/> <QueryStoreProvider/>}export const MyComponent = () => { // This will fetch data from query, using filter specified by QueryStoreProvider. const result = useSourceQuery({ store: QueryStoreProvider, });}
This hook is used to fetch data from the query connected to Query Store.
Remarks
When you have Query Store provider, this hook connects to it, so you'll get data driven by the store.
See
Example