-
Notifications
You must be signed in to change notification settings - Fork 130
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
Rerender the Table when rows change #1306
Conversation
🦋 Changeset detectedLatest commit: 822e72d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/sumup/oss-circuit-ui/AxLRycSKughTy6YUz9jrX4acugMf |
Codecov Report
@@ Coverage Diff @@
## main #1306 +/- ##
==========================================
- Coverage 92.34% 92.22% -0.13%
==========================================
Files 186 186
Lines 3671 3677 +6
Branches 1147 1148 +1
==========================================
+ Hits 3390 3391 +1
- Misses 264 269 +5
Partials 17 17
|
@@ -207,7 +207,7 @@ type TableState = { | |||
class Table extends Component<TableProps, TableState> { | |||
state: TableState = { | |||
sortedRow: undefined, | |||
sortedRows: undefined, | |||
rows: undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be initialized from props, otherwise, the rows aren't shown on the initial render with breaks SSR and can cause other errors.
Follows up on #1292
Purpose
#1292 introduced a bug where if the Table's
rows
prop got an update, the table itself wouldn't get updated.This is an issue when rows state is managed in userland, for example when table filtering is implemented.
Approach and changes
Definition of done