gregnb / gregnb/mui-datatables

customBodyRender won't render new state when changing table page

Open
#1,078 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

When using a custom component (`MyCustomComponent`) its local state doesn't seem to be rendered when moving between pages. The `latest_version` column from the example below is not updated/rendered, retaining the values from the first page, however, when changing the amount of rows per page, the customBodyRender component gets properly rendered.

Here's an example:
https://codesandbox.io/s/friendly-chebyshev-1k89e

Has anyone ever ran into this issue before?
Closest I found so far:
https://github.com/gregnb/mui-datatables/issues/822
https://github.com/gregnb/mui-datatables/issues/643

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the linked CodeSandbox reproduction and trace the table pagination entry point together with customBodyRender. Compare changing pages with changing rows per page, then verify that the latest_version value renders correctly for every page.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.