`getValue` cache not invalidating when `accessorFn` is updated
Maintainer antworten meist innerhalb von 1 Tag
@ahmadelsayed97 arbeitet bereits daran.
Seit 29.8.2026.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- react, typescript
- Bereich
- frontend
Rechercherichtung
Beginne mit der verlinkten StackBlitz-Reproduktion unter src/main.tsx und bestätige, dass eine Zustandsänderung die accessorFn der Spalte aktualisiert, während getValue weiterhin den zwischengespeicherten Wert zurückgibt. Verfolge den Cache von getValue und den Aktualisierungspfad von accessorFn; die Behebung ist abgeschlossen, wenn die angezeigten Werte aktualisiert werden, ohne die Spalten-ID zu ändern oder den aktuellen Sortierstatus zu verlieren.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 28.5k
- Forks
- 3.6k
- Ø Merge
- 17 Std. 39 Min.
- Gemergte PRs (30 T.)
- 10
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus TanStack/table
-
Issue template renders `react-table`, not `TanStack/table`Evtl. vergeben @vishruthasgowda hat das vor 16 Tagen übernommen. Offen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
TanStack/table#6595 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
table-core 9.2.5+: private types leak from .d.ts files, declaration emit fails with TS2883Evtl. vergeben @MFA-G hat das vor 1 Tag übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
[svelte] createTableHook: App* wrappers call setContext in the parent's component context (set_context_after_init when showing a column)Evtl. vergeben @india3Eth hat das vor 1 Tag übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
TanStack/table#6601 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Cast required to access custom options when defining a custom plugin/featureEvtl. vergeben @sorena-paydar hat das vor 17 Tagen übernommen. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
[Bug]: Server git tests sign fixture commits with the developer's key when run from the repo rootOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
melgarafael/DeskcommCRM#2657 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
MystenLabs/MemWal#1163 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
Mondriaan
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
knaw-huc/textannoviz#709 ·
Maintainer antworten meist innerhalb von 1 Tag
-
billion-context-pi
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ranxianglei/billion-context#2521 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag