Fix segment list unique key warning#895
Conversation
The unique key needs to be on the topmost element, which is now 'ThemedTooltip' instead of div.
|
This pull request is deployed at test.editor.opencast.org/895/2022-11-14_11-01-31/ . |
|
Why does it need to be on the topmost element? What is the observable error that this is fixing? |
|
The observable error is a console warning I have not actually tested if it causes problems in this particular case, but it could cause the state of the app to be faulty when the array in question is changed while the page is rendering (element added/removed/swapped etc.). The "key" prop needs to be on topmost element in the iteration because React needs it to be (The "key" prop is used by React behind the scenes to track array elements and minimize rerenders I believe). |
|
This pull request has conflicts ☹ |
|
This pull request is deployed at test.editor.opencast.org/895/2022-12-19_08-50-20/ . |
|
This pull request has conflicts ☹ |
|
This pull request is deployed at test.editor.opencast.org/895/2023-04-20_11-55-32/ . |
The unique key needs to be on the topmost element, which is now
'ThemedTooltip' instead of div.
(Contains #892)