@ai-sdk/react 2.0.0 removes useAssistant, replaces Message and CreateMessage with UIMessage and CreateUIMessage, and reshapes useChat and useCompletion. A component that imports these from @ai-sdk/react, or reads a removed member off what useChat returns, stops type-checking. The AI SDK 5 migration guide is the source for the replacements below.
What changed
- Removed exports.
useAssistantandUseAssistantHelpersare no longer exported, and the package has no hook in their place.MessageandCreateMessagegive way toUIMessageandCreateUIMessage, which hold content inpartsrather than a content string. useChatreturn members.input,setInput,handleInputChangeandhandleSubmitare gone.appendbecomessendMessage,reloadbecomesregenerate,isLoadingbecomesstatus, andexperimental_resumebecomesresumeStream.data,setDataandmetadataare no longer returned.useChatoptions.api,credentials,headers,body,fetch,streamProtocolandexperimental_prepareRequestBodymove to atransport, built withDefaultChatTransport.initialMessagesis nowmessages.initialInput,maxSteps,keepLastMessageOnError,sendExtraMessageFields,keyandonResponseare removed.useCompletion.dataandonResponseare removed. Itsinput,handleInputChange,handleSubmitandisLoadingare unchanged, so leave those reads alone.
Before and after
The one deterministic patch renames a returned member:
// beforeconst resume = () => chat.experimental_resume();
// afterconst resume = () => chat.resumeStream();The other rewrites are assisted. append is one where the shape change is the point:
// beforeconst ask = (text: string) => chat.append({ role: 'user', content: text });
// afterconst ask = (text: string) => chat.sendMessage({ text });The remaining assisted patches cover input state, transport options, messages, status and the removed options.
Migration guidance and its limits
Run emendant scan to list the affected sites, then emendant fix. The experimental_resume rename is a deterministic patch and needs no model provider. The other thirteen findings have assisted patches, and emendant fix writes them only when you name a model provider. Each patch is checked with your typecheck and your tests.
Some edits reach past the component. Moving off data needs the server route to write data parts, and moving off useAssistant means moving the route off the Assistants API. That removal has no direct replacement; review the surrounding code. A patch may not be available for these, or for an onResponse that did more than inspect the status or headers of the response.
Stored messages need attention too. Messages saved in the earlier shape must be converted to parts before they are passed as messages. Code that awaited append or reload for the response must read the last message from messages instead.
No finding in this release is report only. A clean scan covers imports from @ai-sdk/react and the useChat and useCompletion uses described above. It does not check your server routes, your stored messages or your other AI SDK packages.
What Emendant detects, fixes and verifies
14 changes in @ai-sdk/react 2.0.0. 1 automatic fixes, 13 fixes requiring a model provider you choose, 0 report only. Each patch states which checks passed. Understand patch evidence.
| Change | Severity | Detects | Fix | Verified by |
|---|---|---|---|---|
useAssistant was removedai-sdk-react-npm-2.0.0-use-assistant-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
Message and CreateMessage are no longer exported, in favour of UIMessage and CreateUIMessageai-sdk-react-npm-2.0.0-message-types-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useChat no longer manages the inputai-sdk-react-npm-2.0.0-use-chat-input-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useChat's append was removed in favour of sendMessageai-sdk-react-npm-2.0.0-use-chat-append-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useChat's reload was removed in favour of regenerateai-sdk-react-npm-2.0.0-use-chat-reload-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useChat's experimental_resume is now resumeStreamai-sdk-react-npm-2.0.0-use-chat-experimental-resume-renamed | Breaking |
| Patch, written by the rename-property transform | Your typecheck and tests |
useChat's isLoading was removed in favour of statusai-sdk-react-npm-2.0.0-use-chat-is-loading-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useChat no longer returns data, setData or metadataai-sdk-react-npm-2.0.0-use-chat-data-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useChat's request options moved to a transportai-sdk-react-npm-2.0.0-use-chat-request-options-moved-to-transport | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useChat's initialMessages is now messagesai-sdk-react-npm-2.0.0-use-chat-initial-messages-renamed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useChat's maxSteps was removedai-sdk-react-npm-2.0.0-use-chat-max-steps-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useChat's keepLastMessageOnError, sendExtraMessageFields, key and onResponse were removedai-sdk-react-npm-2.0.0-use-chat-options-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useCompletion no longer returns dataai-sdk-react-npm-2.0.0-use-completion-data-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
useCompletion's onResponse was removedai-sdk-react-npm-2.0.0-use-completion-on-response-removed | Breaking |
| Patch, only when you name a model provider | Your typecheck and tests |
emendant explain <change-id> prints any row's entry, guidance and sources at the terminal.
The error TS lines are what TypeScript 5.9.3 printed when code that compiled against @ai-sdk/react 1.2.12 was compiled against 2.0.0. A row without one is a change the compiler does not report, such as a deprecation or a change in behaviour.
Coverage
Requires emendant@0.3.0 or later. Run emendant feed update to get the latest coverage.
Coverage details
- Snapshot
2026-10-21.3, sequence 53, signed 21 October 2026- Feed entry
feed/npm/@ai-sdk/react/2.0.0.json
emendant feed status shows the snapshot your machine holds.
Primary sources
- package.jsonvercel/ai at @ai-sdk/react@2.0.0
- Migration guidevercel/ai at ai@5.0.0
- @ai-sdk/react@2.0.0npm registry, the published package
- @ai-sdk/react@1.2.12npm registry, the published package
- @ai-sdk/ui-utils@1.2.11npm registry, the published package
- ai@5.0.0npm registry, the published package
Scan your repository
Find affected code without editing your files.
npx emendant scanThen npx emendant fix writes the patches the table says exist. The getting started guide covers the flags and the patch grades.
Related release pages
- Later @ai-sdk/react release: @ai-sdk/react@4.0.162: experimental_MCPAppRenderer deprecated
Every @ai-sdk/react release page is listed on one page.