`getValue` cache not invalidating when `accessorFn` is updated
維護者通常 1 天內回覆
@ahmadelsayed97 已經在處理了。
開始於 2026年8月29日。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- react, typescript
- 領域
- frontend
研究方向
從連結的 StackBlitz 重現開始,在 src/main.tsx 中確認變更狀態會更新欄的 accessorFn,而 getValue 仍然回傳快取的值。追蹤 getValue 快取和 accessorFn 更新路徑;當顯示的值重新整理且不變更欄 id 或遺失目前的排序狀態時,修正即完成。
由索引模型根據 Issue 內容生成。
描述
TanStack Table version
v8.12.0
Framework/Library version
React v18.2.0
Describe the bug and the steps to reproduce it
When the accessorFn for a column is updated to return a new value, the new value is never displayed in the table. Through a sophisticated series of console.logs, I discovered that when getValue is called on the rerender, the new accessorFn is never called, presumably due to caching on column id.
The use case is a column that displays the name of the person for the current row. We want the user to be able to choose whether to display first or last name first (e.g. Tanner Linsley or Linsley, Tanner). We could just change the column id when the accessorFn is updated, but then we lose the current sort state for that column, ie if the table is currently sorted by name, we want to stay sorted by name after the name format is changed.
Steps to reproduce:
- Define a column where the
accessorFnreturns a different value based on some piece of state - Update that piece of state
- The values in the column don't change
Your Minimal, Reproducible Example - (Sandbox Highly Recommended)
https://stackblitz.com/edit/tanstack-table-rnjqkx?file=src%2Fmain.tsx
Screenshots or Videos (Optional)
No response
Do you intend to try to help solve this bug with your own PR?
No, because I do not know how
Terms & Code of Conduct
- I agree to follow this project's Code of Conduct
- I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
- 主要語言
- TypeScript
- 星號
- 28.5k
- 分支
- 3.6k
- 平均合併
- 17 小時 39 分鐘
- 30 天內合併 PR
- 10
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
TanStack/table 的其他 Issue
-
Issue template renders `react-table`, not `TanStack/table`可能已有人在做 @vishruthasgowda 於 16 天前認領。 未關閉
難度 1/5 1 小時以內 新手友好度 78/100
維護者通常 1 天內回覆
-
table-core 9.2.5+: private types leak from .d.ts files, declaration emit fails with TS2883可能已有人在做 @MFA-G 於 1 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 74/100
維護者通常 1 天內回覆
-
[svelte] createTableHook: App* wrappers call setContext in the parent's component context (set_context_after_init when showing a column)可能已有人在做 @india3Eth 於 2 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 68/100
維護者通常 1 天內回覆
-
難度 4/5 3-5 天 新手友好度 38/100
維護者通常 1 天內回覆
-
Cast required to access custom options when defining a custom plugin/feature可能已有人在做 @sorena-paydar 於 17 天前認領。 未關閉
難度 5/5 一週以上 新手友好度 35/100
維護者通常 1 天內回覆
相似的 Issue
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster no-stale P2
難度 2/5 1-3 小時 新手友好度 72/100
openclaw/openclaw#168089 · 2 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
✨ enhancement needs-discussion
難度 1/5 1 小時以內 新手友好度 85/100
-
[Bug]: [MCP/CLI] Bare loopback IP addresses (127.0.0.1:port) and hosts with ports fail to navigate due to erroneous scheme inference可能已有人在做 @alok-108 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
microsoft/playwright#43263 ·
維護者通常 1 天內回覆
-
area:studio type:security
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
enhancement good first issue Stellar Wave trivial
難度 2/5 1-3 小時 新手友好度 85/100
StellarCanary/ProtocolCanary-Action#331 ·
維護者通常 1 天內回覆