Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/src/pages/guides/migrating-to-react-query-3.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ The `ReactQueryCacheProvider` component has been replaced by the `QueryClientPro

### makeQueryCache()

The `makeQueryCache()` function has replaced by `new QueryCache()`.
The `makeQueryCache()` function has been replaced by `new QueryCache()`.

### ReactQueryErrorResetBoundary

Expand Down
8 changes: 4 additions & 4 deletions docs/src/pages/guides/queries.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ const result = useQuery('todos', fetchTodoList)

The `result` object contains a few very important states you'll need to be aware of to be productive. A query can only be in one of the following states at any given moment:

- `isLoading` or `status === 'loading' - The query has no data and is currently fetching
- `isLoading` or `status === 'loading'` - The query has no data and is currently fetching
- `isError` or `status === 'error'` - The query encountered an error
- `isSuccess` or `status === 'success' - The query was successful and data is available
- `isIdle` or `status === 'idle' - The query is currently disabled (you'll learn more about this in a bit)
- `isSuccess` or `status === 'success'` - The query was successful and data is available
- `isIdle` or `status === 'idle'` - The query is currently disabled (you'll learn more about this in a bit)

Beyond those primary state, more information is available depending on the state the query:

- `error` - If the query is in an `isError` state, the error is available via the `error` property.
- `data` - If the query is in a `success` state, the data is available via the `data` property.
- `isFetching` - In any state, if the query is fetching at any time (including background refetching) `isFetching` will be `true`.

For **most** queries, it's usually sufficient to check for the `isLoading` state, then the `isError` state, then finally, assume that the data is avaiable and render the successful state:
For **most** queries, it's usually sufficient to check for the `isLoading` state, then the `isError` state, then finally, assume that the data is available and render the successful state:

```js
function Todos() {
Expand Down