Repository navigation
fix(ai-components): document a StrictMode-safe controller lifecycle and custom.uiAction - #3975
Merged
Merged
Conversation
…and custom.uiAction Create AIConversationController in the effect that disposes it, so React StrictMode's cleanup-then-rerun doesn't leave the views with a disposed controller. Document that a generated-UI action travels on AIConversationRequest.custom.uiAction, and add a Conversation state section to the ai-components README. The Expo agent examples turn off edit and regenerate: the agents router keeps the conversation in Stream Chat and can't rewind it.
Contributor
SDK Size
|
isekovanic
approved these changes
Nov 11, 2026
oliverlaz
requested review from
MartinCupela,
aleksandar-apostolov,
isekovanic and
martinmitrevski
November 11, 2026 16:18
isekovanic
approved these changes
Nov 11, 2026
4 of 6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: https://linear.app/stream/issue/RN-524
What
AIConversationControllerdoc + new README "Conversation state" section: create the controller insideuseEffect, dispose it and clear state in the cleanup, render nothing until it exists. The previoususeState(() => new …)+ dispose-on-cleanup example breaks under React StrictMode (cleanup disposes the controller, the remount keeps using it).AIConversationRequest.custom.uiAction(types and README). Docs only, no runtime change.actions: { edit: false, regenerate: false }: the Stream Agents router can't rewind a conversation, so edit and regenerate would just re-ask as a new question.The two Expo examples create controllers in an event handler and dispose the previous one on switch, so they don't have the StrictMode bug.
Checks
yarn lintyarn typecheckyarn test:unityarn build