# Upgrading

## Upgrade to v9

The rejection value for failed requests with `useFetch` was changed. Previously it was the Response object. Now it's an Error object with `response` property. If you are using `useFetch` and are using the `error` value, expecting it to be of type Response, you must now use `error.response` instead.

## Upgrade to v8

All standalone helper components were renamed to avoid import naming collision.

* `<Initial>` was renamed to `<IfInitial>`.
* `<Pending>` was renamed to `<IfPending>`.
* `<Fulfilled>` was renamed to `<IfFulfilled>`.
* `<Rejected>` was renamed to `<IfRejected`.
* `<Settled>` was renamed to `<IfSettled>`.

> A [codemod](https://github.com/async-library/react-async/tree/master/codemods) is available to automate the upgrade.

The return type for `run` was changed from `Promise` to `undefined`. You should now use the `promise` prop instead. This is a manual upgrade. See [`promise`](/api/state.md#promise) for details.

## Upgrade to v6

* `<Async.Pending>` was renamed to `<Async.Initial>`.
* Some of the other helpers were also renamed, but the old ones remain as alias.
* Don't forget to deal with any custom instances of `<Async>` when upgrading.

> A [codemod](https://github.com/async-library/react-async/tree/master/codemods) is available to automate the upgrade.

## Upgrade to v4

* `deferFn` now receives an `args` array as the first argument, instead of arguments to `run` being spread at the front of the arguments list. This enables better interop with TypeScript. You can use destructuring to keep using your existing variables.
* The shorthand version of `useAsync` now takes the `options` object as optional second argument. This used to be `initialValue`, but was undocumented and inflexible.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.react-async.com/getting-started/upgrading.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
