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
setThreadId function in package/react/src/use-assistant.ts : whenever input or messages change, the setThreadId function is changing.
i am using searchParam to get the threadId for my application. whenever the threadId in the searchParam changes, i am setting the threadId of the current chat by using "setThreadId" function from useAssistant() hook.
now by following react-hooks rules, I’ve included setThreadId as a dependency in the useEffect hook. However, this results in the useEffect firing even when the input or messages change, because the setThreadId function is changing frequently.
Description
setThreadId function in package/react/src/use-assistant.ts : whenever input or messages change, the setThreadId function is changing.
i am using searchParam to get the threadId for my application. whenever the threadId in the searchParam changes, i am setting the threadId of the current chat by using "setThreadId" function from useAssistant() hook.
now by following react-hooks rules, I’ve included setThreadId as a dependency in the useEffect hook. However, this results in the useEffect firing even when the input or messages change, because the setThreadId function is changing frequently.
Code example
here if i not include setThreadId in the dependency, then everything works fine. but actually it is depending on "setThreadId"
Additional context
No response
The text was updated successfully, but these errors were encountered: