You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
getValue cache not invalidating when accessorFn is updated #5363
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 accessorFn returns 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)
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.
Any updates on this? I'm seeing the same issue where a piece of state changes the value returned by the accessorFn but the new value isn't being shown in the table
We had the same issue in our project. The suggested fix in #5582 fixes the issue for us. We've applied the fix with yarn patch until it is merged and released.
Reacted by Takeshi Takeda, Jonah Allibone, paul-ivancsics and SC
aliceprobstexternalairbus commented on Mar 16, 2026
Activity
badench commentedon Mar 25, 2024
Any updates on this? I'm seeing the same issue where a piece of state changes the value returned by the
accessorFnbut the new value isn't being shown in the tabletakoshi commentedon May 20, 2024
I found the same issue on my project. I suspect that the following code causes it
table/packages/table-core/src/core/row.ts
Lines 113 to 129 in 6d89e41
table/packages/table-core/src/utils/getCoreRowModel.ts
Lines 9 to 48 in 6d89e41
Summary
getInfofunction inrowreturns a cached value if it exists. (Probably) Cached values are not invalidated until the rows are removed from memory.createRowingetCoreRowModel.getCoreRowModelonly depends ondata, so rows are not (re)built by updatingcolumnDefs.I think there are some ways to fix the bug.
CoreRowmanagesaccessorFn. IfCoreRowdetects difference between managedaccessorFnand latest one, itwill invalidate cached data.
getCoreRowModeldepends ondataandcolumnDefs.andbjer commentedon Sep 9, 2024
We had the same issue in our project. The suggested fix in #5582 fixes the issue for us. We've applied the fix with
yarn patchuntil it is merged and released.aliceprobstexternalairbus commentedon Mar 16, 2026
Any news on this ? We're having the same issue.
fix(table-core): clear row value caches when column defs are replaced