--- id: background-fetching-indicators title: Background Fetching Indicators ref: docs/framework/react/guides/background-fetching-indicators.md replace: { 'hook': 'function' } --- [//]: # 'Example' ```tsx import { Switch, Match, Show, For } from 'solid-js' function Todos() { const todosQuery = useQuery(() => ({ queryKey: ['todos'], queryFn: fetchTodos, })) return ( Loading... Error: {todosQuery.error.message}
Refreshing...
{(todo) => }
) } ``` [//]: # 'Example' [//]: # 'Example2' ```tsx import { useIsFetching } from '@tanstack/solid-query' function GlobalLoadingIndicator() { const isFetching = useIsFetching() return (
Queries are fetching in the background...
) } ``` [//]: # 'Example2'