You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
data is an empty array in my use case and it is causing streamData being modified. As it is a dependency for triggerRequest and triggerRequest is a dependency for append, reload and handleSubmit, useCallback returns a new function every time an update occurs when reading from the stream.
A simple modification avoids this behavior (and consequently unnecessary re-renders):
Description
In use-chat.ts:
data
is an empty array in my use case and it is causingstreamData
being modified. As it is a dependency fortriggerRequest
andtriggerRequest
is a dependency forappend
,reload
andhandleSubmit
,useCallback
returns a new function every time an update occurs when reading from the stream.A simple modification avoids this behavior (and consequently unnecessary re-renders):
Code example
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: