Uh oh!
There was an error while loading. Please reload this page.
fix(solid-router): Should not remount deps when remountDeps does not change - #5693
Conversation
WalkthroughRe-enables an end-to-end test and changes Match rendering to compute a componentKey (from matchState().key or match id) and render the matched component via a keyed wrapper, enabling controlled remount behavior based on the computed key. Changes
Sequence Diagram(s)sequenceDiagram
participant Router as Router / Match
participant MatchComp as Match.tsx logic
participant Component as Matched Component
Note over Router,Component: Before — direct render (no controlled keying)
Router->>MatchComp: matchState() updates
MatchComp->>Component: render (no explicit remount key)
Note over Router,Component: After — compute key and conditionally remount
Router->>MatchComp: matchState() updates
MatchComp->>MatchComp: compute componentKey = matchState().key || match.id
MatchComp->>MatchComp: wrap render in keyed Show (keyedOut)
alt componentKey unchanged
MatchComp->>Component: keep existing instance (no remount)
else componentKey changed
MatchComp->>Component: remount new instance
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
View your CI Pipeline Execution ↗ for commit 2c5fa6a
☁️ Nx Cloud last updated this comment at |
More templates
@tanstack/arktype-adapter@tanstack/directive-functions-plugin@tanstack/eslint-plugin-router@tanstack/history@tanstack/nitro-v2-vite-plugin@tanstack/react-router@tanstack/react-router-devtools@tanstack/react-router-ssr-query@tanstack/react-start@tanstack/react-start-client@tanstack/react-start-server@tanstack/router-cli@tanstack/router-core@tanstack/router-devtools@tanstack/router-devtools-core@tanstack/router-generator@tanstack/router-plugin@tanstack/router-ssr-query-core@tanstack/router-utils@tanstack/router-vite-plugin@tanstack/server-functions-plugin@tanstack/solid-router@tanstack/solid-router-devtools@tanstack/solid-router-ssr-query@tanstack/solid-start@tanstack/solid-start-client@tanstack/solid-start-server@tanstack/start-client-core@tanstack/start-plugin-core@tanstack/start-server-core@tanstack/start-static-server-functions@tanstack/start-storage-context@tanstack/valibot-adapter@tanstack/virtual-file-routes@tanstack/zod-adaptercommit: |
closes#5683
Summary by CodeRabbit
Tests
Bug Fixes