fix: refresh virtual rows when rowKey changes - #64
Open
nrps9909 wants to merge 1 commit into
Open
Conversation
|
@nrps9909 is attempting to deploy a commit to the React Component Team on Vercel. A member of the Team first needs to authorize it. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #64 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 216 216
Branches 56 55 -1
=========================================
Hits 216 216 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
aojunhao123
approved these changes
Aug 30, 2026
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.
Summary
rowKeycontract changesrowKey="id"torowKey="slug"Root cause
useItemKeyreturned a stableuseEventfunction, whileuseFlattenRowsused that function as a memo dependency. ChangingrowKeywith the sameitemsarray therefore left the virtual rows memoized under the old tagged keys. Raw mode called the latest event function during render, so the two modes diverged.Verification
f71de19007a04a1689c78cec1a612c2ca2af2983rowKey="id"torowKey="slug", the virtual row remaineditem:1instead ofitem:firstnpm test -- --runInBand— 4 suites, 51 tests, 1 snapshot passednpm run lint— passednpm run compile— ESM, CJS, declarations, and Less build passedgit diff --check— passedAI assistance disclosure: Codex was used to trace the stale memo dependency, construct the exact-base rerender regression, implement the scoped fix, and draft this report. I verified the before/after key values and all listed checks locally.