Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

`getValue` cache not invalidating when `accessorFn` is updated

Offen
#5,363 4 Kommentare 12 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@ahmadelsayed97 arbeitet bereits daran.

Seit 29.8.2026.

  • #6556 von @ErfanBagheri404 — ohne Merge geschlossen
  • #6581 von @ahmadelsayed97 — offen
  • #6613 von @boriskozak — offen

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:

  1. Define a column where the accessorFn returns a different value based on some piece of state
  2. Update that piece of state
  3. 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

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus TanStack/table

Alle Issues in TanStack/table

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.