Skip to content

Commit b1b4acb

Browse files
committed
Migrate from React-Markdown to Streamdown
1 parent 049d689 commit b1b4acb

File tree

3 files changed

+1143
-46
lines changed

3 files changed

+1143
-46
lines changed

packages/ai/components/message.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import type { Message as MessageType } from "ai";
22
import type { ComponentProps } from "react";
3-
import Markdown from "react-markdown";
3+
import { Streamdown } from "streamdown";
44
import { twMerge } from "tailwind-merge";
55

66
type MessageProps = {
77
data: MessageType;
8-
markdown?: ComponentProps<typeof Markdown>;
8+
markdown?: ComponentProps<typeof Streamdown>;
99
};
1010

1111
export const Message = ({ data, markdown }: MessageProps) => (
@@ -17,6 +17,6 @@ export const Message = ({ data, markdown }: MessageProps) => (
1717
: "self-start bg-muted"
1818
)}
1919
>
20-
<Markdown {...markdown}>{data.content}</Markdown>
20+
<Streamdown {...markdown}>{data.content}</Streamdown>
2121
</div>
2222
);

packages/ai/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@t3-oss/env-nextjs": "^0.13.8",
1212
"ai": "^5.0.80",
1313
"react": "19.2.0",
14-
"react-markdown": "^10.1.0",
14+
"streamdown": "^1.6.4",
1515
"tailwind-merge": "^3.3.1",
1616
"zod": "^4.1.12"
1717
},

0 commit comments

Comments
 (0)