File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -15,13 +15,15 @@ function Profile() {
1515 if (error ) return ' Unknown error' ;
1616 return ` Hello ${response ?.email } ` ;
1717}
18+ ```
1819
1920## Lazy Queries
2021
2122To enable a query at a later time (for example if the query depends on a previous query),
2223the method can be set to ` null ` which will effectively defer the query until the query
2324method is defined.
2425
26+ ``` tsx
2527function ToDos() {
2628 const [filter, setFilter] = useState (false );
2729 const { response } = useQuery (' /todos' , { method: filter ? ' GET' : null });
Original file line number Diff line number Diff line change 1616 * if (error) return 'Unknown error';
1717 * return `Hello ${response?.email}`;
1818 * }
19+ * ```
1920 *
2021 * ## Lazy Queries
2122 *
2223 * To enable a query at a later time (for example if the query depends on a previous query),
2324 * the method can be set to `null` which will effectively defer the query until the query
2425 * method is defined.
2526 *
27+ * ```tsx
2628 * function ToDos() {
2729 * const [filter, setFilter] = useState(false);
2830 * const { response } = useQuery('/todos', { method: filter ? 'GET' : null });
You can’t perform that action at this time.
0 commit comments