Remove memo wrapper from Response component (#1391)

This commit is contained in:
Nico Albanese 2026-01-15 13:09:34 +00:00 committed by GitHub
parent 22de923298
commit f19d3d4071
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 12 additions and 54 deletions

View file

@ -1,22 +1,19 @@
"use client";
import { type ComponentProps, memo } from "react";
import type { ComponentProps } from "react";
import { Streamdown } from "streamdown";
import { cn } from "@/lib/utils";
type ResponseProps = ComponentProps<typeof Streamdown>;
export const Response = memo(
({ className, ...props }: ResponseProps) => (
<Streamdown
className={cn(
"size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_code]:whitespace-pre-wrap [&_code]:break-words [&_pre]:max-w-full [&_pre]:overflow-x-auto",
className
)}
{...props}
/>
),
(prevProps, nextProps) => prevProps.children === nextProps.children
export const Response = ({ className, ...props }: ResponseProps) => (
<Streamdown
className={cn(
"size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_code]:whitespace-pre-wrap [&_code]:break-words [&_pre]:max-w-full [&_pre]:overflow-x-auto",
className
)}
{...props}
/>
);
Response.displayName = "Response";