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
In Vue it is impossible to change id for useChat component based on a prop value (or a route parameter), since properties are reactive and id value must be fixed at setup stage.
Differently from React, the setup function is not re-executed every time props change, but rather the properties themselves are reactive.
The standard pattern for Vue composables that have to react to their input is to accept a MaybeRef<T> as a parameter and use computed/watch/watchEffect to handle changes to the parameter, rather than rely on useChat being invoked again when they change.
The text was updated successfully, but these errors were encountered:
Description
In Vue it is impossible to change id for
useChat
component based on a prop value (or a route parameter), since properties are reactive andid
value must be fixed at setup stage.Code example
AI provider
No response
Additional context
Differently from React, the
setup
function is not re-executed every time props change, but rather the properties themselves are reactive.The standard pattern for Vue composables that have to react to their input is to accept a
MaybeRef<T>
as a parameter and usecomputed
/watch
/watchEffect
to handle changes to the parameter, rather than rely onuseChat
being invoked again when they change.The text was updated successfully, but these errors were encountered: