- Accordion
- Attachment
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Card
- Checkbox
- Code Block
- Collapsible
- Dialog
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP
- Item
- Label
- Marker
- Message
- Number Flow
- Pagination
- Popover
- Progress
- Radio Group
- Select
- Slider
- Sonner
- Spinner
- Switch
- Tooltip
- Separator
- Sheet
- Tabs
- Textarea
- Toggle
- Toggle Group
- Trace
Frakment targets React 19. Most components are drop-in compatible with React 18, but a few rely on React 19 features. This page covers what changes, what breaks, and how to migrate.
Prerequisites
- React 19.0 or newer
- TypeScript 5.7 or newer
- Node.js 20 or newer
Peer dependencies
Frakment components expect React 19. If you use the engine packages, add both as peers:
{
"peerDependencies": {
"react": "^19.0.0",
"react-dom": "^19.0.0"
}
}@frakment/ai supports React 19.
Components that require React 19
Most primitives (button, input, card, dialog) work on React 18.3. The following components require React 19:
| Component | React 19 feature |
|---|---|
message-animated | useOptimistic for streaming UI |
trace | useTransition for collapse animation |
code-block | Ref cleanup function |
bubble | Ref as a prop (no forwardRef) |
The rest compile on React 18.3 but are only tested on React 19.
Breaking changes to watch
ref as a prop
React 19 allows ref without forwardRef. Frakment components use this in new files. Old files that still use forwardRef still compile, but the wrapper is redundant.
React 18, with forwardRef:
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>((props, ref) => (
<button ref={ref} {...props} />
));React 19, ref as a prop:
function Button({ ref, ...props }: ButtonProps & { ref?: React.Ref<HTMLButtonElement> }) {
return <button ref={ref} {...props} />;
}Ref cleanup
ref callbacks can return a cleanup function. Returning a value in React 18 triggers a warning:
<div ref={(node) => {
setup(node);
return () => teardown(node);
}} />The use hook
Some engine files use use(Promise) for async boundaries. It works in React 19 only.
useFormStatus and useActionState
Form primitives in Frakment use these hooks. They do not exist in React 18.
Migrating from React 18
Bump React
$ bun add react@^19 react-dom@^19$ npm install react@^19 react-dom@^19$ pnpm add react@^19 react-dom@^19$ yarn add react@^19 react-dom@^19
Bump types
$ bun add -D @types/react@^19 @types/react-dom@^19$ npm install -D @types/react@^19 @types/react-dom@^19$ pnpm add -D @types/react@^19 @types/react-dom@^19$ yarn add -D @types/react@^19 @types/react-dom@^19
Reinstall components
For every installed component, re-run:
$ bunx --bun frakment@latest add <component> --overwrite$ npx frakment@latest add <component> --overwrite$ pnpm dlx frakment@latest add <component> --overwrite$ yarn dlx frakment@latest add <component> --overwrite
This pulls the React 19 compatible version from the registry.
Typecheck
$ bunx --bun tsc --noEmit$ npx tsc --noEmit$ pnpm dlx tsc --noEmit$ yarn dlx tsc --noEmit
Look for ref callback warnings and forwardRef removals.
Common errors
React 19 removes the deprecated forwardRef calls from the default export. Use the new ref prop style instead.
Two React copies are installed. Check npm ls react. Deduplicate by hoisting React to the root of the workspace.
Next
- Tailwind CSS v4 - required version
- Monorepo - shared UI package
- React 19 release notes - official changes