This repository was archived by the owner on Oct 17, 2026. It is now read-only.
Repository navigation
Remount the reaction view when the reaction ID changes - #222
Merged
Merged
Conversation
MainReactionView keeps its record, tab selections, and pending fetches in component state, so a route change from one reaction to another reused them. A selected input tab past the new reaction's input count indexed off the end of the inputs and crashed the render. Keying the view by reaction ID gives each reaction a fresh instance. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Holds the first reaction's response until after the route has moved to a second reaction and that one has rendered. Without the keyed remount, the late response replaces the second reaction's inputs with the first's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Holds the next reaction's response and checks that the previous reaction's inputs are gone once the route changes. The first routing test asserts only the input tab, so its name now says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
MainReactionViewkept its state across a change of/id/:reactionId:inputsMapand crashed the render (Cannot read properties of undefined (reading '1'))./id/ord-2showed ord-1's inputs.Changes
App.tsx:ReactionRoutereadsreactionIdand renders<MainReactionView key={reactionId} />.App.test.tsx: one test per symptom above, each routing between reactions viapopstate.Testing
npx tsc -b,npm run lint,npm run format:check,npm test(420 passed).main'sApp.tsx: ord-1's input tab still rendered, theTypeErrorabove, and ord-1's input tabs where ord-2's belong.Notes
ReactionCardis the only link to/id/…, and the reaction page doesn't render one.ord-schemanpm package, which Read reactions with the protobuf-es SDK from the Buf Schema Registry #221 removes. Whichever of the two lands second portsencodedReactioninApp.test.tsxto protobuf-es.🤖 Generated with Claude Code
The PR appears safe to merge; no outstanding findings remain.
Summary
The route now keys
MainReactionViewby reaction ID, giving each reaction fresh view state. The added tests cover tab reset, the loading state, and a late response from the previous reaction.Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A["Route to reaction ID"] --> B["Key MainReactionView by ID"] B --> C["Unmount previous view"] B --> D["Mount fresh view with loading state"] D --> E["Render new reaction"]Reviews (3) · Last reviewed commit: "Test that the previous reaction gives wa..."