Uh oh!
There was an error while loading. Please reload this page.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
请让同步 effect 在
data变化时重新运行。index的解析依赖当前data,但该 effect 的依赖数组没有data。如果先调用scrollTo({ key: '30' }),目标尚不存在,第一次 effect 会保存index = -1并结束。之后列表在另一次 render 中加入目标项时,syncState和容器引用都不变,effect 不会再次执行,滚动请求会永久停留在-1。请将data加入依赖数组,并补充跨两个 render 的回归测试。建议修改
🤖 Prompt for AI Agents