TanStack / TanStack/table

incorrect Row ID in "Pagination Controlled" react example

Open
#4,848 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
28.4k
Forks
3.6k
Avg merge
1d 14h
Merged PRs (30d)
10

Description

Describe the bug

The row ID and index are not changing when switching pages while using manual pagination with react query data.
This bug means each row after the first page is receiving an incorrect key because <tr key={row.id}>
This could be related to #4812 and #4771
This is the example from the docs and below is the modified version to highlight the incorrect row IDs in the console.

Your minimal, reproducible example

https://codesandbox.io/s/throbbing-wildflower-byp0ht?file=/src/main.tsx

Steps to reproduce
  1. open console
  2. switch between pages
  3. notice the row IDs are not changing
Expected behavior

The row IDs should change when switching pages.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform
  • OS: Linux
  • Browser: Chrome
  • Version: 113
react-table version

v8.9.1

TypeScript version

No response

Additional context

No response

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Pagination Controlled React example linked in the issue and reproduce the behavior using the provided CodeSandbox. Switch pages while watching the console to determine why the row IDs and indexes remain unchanged; done means the example reports the correct IDs and indexes for each page.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.