From c7aabed543f4da78b4d550aae1bb092b3b5febad Mon Sep 17 00:00:00 2001 From: itacoount Date: Thu, 4 Dec 2025 21:14:54 +0000 Subject: [PATCH] adding usememo --- .../components/ai-elements/reasoning.tsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/examples/next-openai/components/ai-elements/reasoning.tsx b/examples/next-openai/components/ai-elements/reasoning.tsx index d999ca26db3b..7b10e25c8ab1 100644 --- a/examples/next-openai/components/ai-elements/reasoning.tsx +++ b/examples/next-openai/components/ai-elements/reasoning.tsx @@ -9,7 +9,14 @@ import { import { cn } from '@/lib/utils'; import { BrainIcon, ChevronDownIcon } from 'lucide-react'; import type { ComponentProps } from 'react'; -import { createContext, memo, useContext, useEffect, useState } from 'react'; +import { + createContext, + memo, + useContext, + useEffect, + useMemo, + useState, +} from 'react'; import { Response } from './response'; type ReasoningContextValue = { @@ -95,7 +102,15 @@ export const Reasoning = memo( return ( ({ + isStreaming, + isOpen, + setIsOpen, + duration, + }), + [isStreaming, isOpen, setIsOpen, duration], + )} >