Migrating to 3.x
The 3.x line of reachat is a substantial release. This guide covers what changed, what broke, and what to do about it. If youβre already on 3.x and upgrading minor versions, jump to the Changelog instead.
Quick checklist
If youβre moving from 2.x β 3.x, expect to touch:
- React 19 β bump your appβs React peer dependency.
- reablocks 10 β bump reablocks; check any custom
<Button>adornments. - Mentions / commands API β old
MentionPluginConfig/SlashCommandPluginConfigtypes are deprecated in favor of unifiedSuggestionConfig<T>with atriggerfield. - Charts β charts are now registered through the
Component Catalog using
createChartComponentDef(). - No bundled
@tiptap/*β these are now direct dependencies of reachat; you can remove them from your ownpackage.jsonif you only had them to support reachatβs input.
The next sections walk through each change in detail.
React 19
reachat 3.1 requires React 19 (it still works on React 18 in most setups, but peer deps target 19). If youβre on 18 and ready to upgrade:
npm install react@^19 react-dom@^19Most React 18 code runs unchanged on 19. Watch for the well-known breakages
(stricter ref behaviour, automatic batching of state setters, etc.) β see
Reactβs official upgrade guideΒ .
reablocks 10
reachat 3.1 was rebuilt on top of reablocks 10Β . The
public reachat API didnβt change as a result β but if youβre customizing
buttons in your own components, the Button adornment props were renamed:
| reablocks 9 | reablocks 10 |
|---|---|
startAdornment | start |
endAdornment | end |
Update your own code accordingly. reachatβs internal usage already uses the new names.
Unified mentions and commands API
Pre-3.x, mentions and slash commands had separate configuration types
(MentionPluginConfig, SlashCommandPluginConfig, InputPluginItem,
InputTrigger). 3.x consolidates these into a single
SuggestionConfig<T> with a
trigger field.
Before:
<RichTextInput
plugins={[
{
trigger: '@',
items: users,
// ...
}
]}
/>After:
<ChatInput
mentions={{
trigger: '@',
items: users,
onSelect: (item) => console.log(item)
}}
commands={{
trigger: '/',
items: slashCommands,
onSelect: (item) => runCommand(item.id)
}}
/>The old types are still exported for backward compatibility, but they alias to the new shape β migrate when convenient. Full reference: Mentions and Slash Commands.
Charts via the Component Catalog
In 2.x, charts shipped as standalone components. In 3.x theyβre registered
through the Component Catalog using
createChartComponentDef() so the LLM can emit chart specs directly in
fenced code blocks.
Before:
import { Chart } from 'reachat';
<Chart type="bar" data={...} />After:
import {
Chat,
componentCatalog,
createChartComponentDef
} from 'reachat';
const catalog = componentCatalog({
Chart: createChartComponentDef()
});
<Chat sessions={sessions} components={catalog}>
{/* ... */}
</Chat>The LLM then produces:
```component
{
"type": "Chart",
"props": {
"type": "bar",
"data": [{ "key": "A", "data": 10 }, { "key": "B", "data": 20 }]
}
}
```See the Charts page for the full set of supported chart types and props.
Tiptap is now a direct dep
reachat 3.1 promoted @tiptap/suggestion and @tiptap/extensions to direct
dependencies. If you previously installed them yourself in order to extend the
input, you can remove them from your package.json β reachat ships them.
Whatβs new in 3.x
While youβre upgrading, take advantage of these additions:
- Component Catalog (3.0) β let the LLM render any React component you register. See Component Catalog.
useAgUihook (3.x) β drop-in support for any AG-UIΒ compatible agent. See AG-UI.autoScrollon<SessionMessages>(3.2) β auto-pin to the bottom of the conversation while streaming.allowMultipleFileson<ChatInput>(3.2) β multi-file uploads. See File Uploads.onMessageChangeandclassNameon<ChatInput>(3.2.1) β controlled-input draft persistence and styling overrides.PartialChatThemeexport (3.2) β easier deep-partial theme overrides.- Expanded markdown theme tokens (3.2) β including
h1βh6,inlineCode, andhrundermessages.message.markdown.
For the full release-by-release list, see the Changelog.