-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(fix) service queues: Fix React missing key warning for table filters…
… in QueueTable This PR fixes a missing React key warning for the tableFilter prop in QueueTable. `tableFilter` is an array of React nodes that get rendered as children of the `TableToolbarContent` component. I've renamed the prop to `tableFilters` to better describe that it's an array of filters. Second, I've updated the rendering logic to use the `map` function to iterate over the `tableFilters` array and provide a unique `key` prop to each child. I'm using a `React.Fragment` to wrap each child in the array to avoid unnecessary additional DOM elements. Each of these fragments uses the index of the array as the key. This is not a perfect solution in the sense that keys should be stable and unique identifiers for elements in the array. However, in this case, the array contents are dynamic and may change in size, so a static index identifier works for now. I've also added keys to the `QueueTableByStatusMenu` and `QueueTableMetricsCard` components. I've also fixed the spacing of the filters in the `QueueTable` component as well as removed some unnecessary space from the filter label text.
- Loading branch information
1 parent
a14dade
commit 379d1ce
Showing
6 changed files
with
35 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters