Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(data-table): key by row id, not data #19413

Merged
merged 2 commits into from
Dec 19, 2023
Merged

Conversation

mariusandra
Copy link
Collaborator

@mariusandra mariusandra commented Dec 19, 2023

Problem

Fixes https://posthog.slack.com/archives/C0368RPHLQH/p1702955395630629

With many similar columns, the data table stopped updating when data changed slightly.

Changes

Key the table rows by their index, not by the data. We can't guarantee even columns like "uuid" to contain unique values, so stop trying. JSON.stringify(result) was the worst offending key.

How did you test this code?

I could reproduce the problem case locally, and this fix solved it. I also got rid of thousands of react warnings in the console.

Copy link
Contributor

Size Change: 0 B

Total Size: 2 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 2 MB

compressed-size-action

@mariusandra mariusandra changed the title Fix data table rendering fix(data-table): key by row id, not data Dec 19, 2023
@mariusandra mariusandra requested a review from a team December 19, 2023 16:56
@mariusandra mariusandra merged commit 98accb3 into master Dec 19, 2023
82 of 83 checks passed
@mariusandra mariusandra deleted the fix-data-table-rendering branch December 19, 2023 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant