Skip to content

Fix segment list unique key warning#895

Merged
lkiesow merged 3 commits into
opencast:mainfrom
Arnei:fix-segment-list-unique-key-warning
Apr 20, 2023
Merged

Fix segment list unique key warning#895
lkiesow merged 3 commits into
opencast:mainfrom
Arnei:fix-segment-list-unique-key-warning

Conversation

@Arnei
Copy link
Copy Markdown
Member

@Arnei Arnei commented Nov 14, 2022

The unique key needs to be on the topmost element, which is now
'ThemedTooltip' instead of div.

(Contains #892)

The unique key needs to be on the topmost element, which is now
'ThemedTooltip' instead of div.
@github-actions
Copy link
Copy Markdown

This pull request is deployed at test.editor.opencast.org/895/2022-11-14_11-01-31/ .
It might take a few minutes for it to become available.

@Arnei Arnei added the type:bug Something isn't working label Nov 14, 2022
@lkiesow
Copy link
Copy Markdown
Member

lkiesow commented Nov 23, 2022

Why does it need to be on the topmost element? What is the observable error that this is fixing?

@Arnei
Copy link
Copy Markdown
Member Author

Arnei commented Nov 24, 2022

The observable error is a console warning

Warning: Each child in a list should have a unique "key" prop.

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).

@github-actions github-actions Bot added the status:conflicts Conflicts with another pull request or issue label Dec 19, 2022
@github-actions
Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@github-actions github-actions Bot removed the status:conflicts Conflicts with another pull request or issue label Dec 19, 2022
@github-actions
Copy link
Copy Markdown

This pull request is deployed at test.editor.opencast.org/895/2022-12-19_08-50-20/ .
It might take a few minutes for it to become available.

@github-actions
Copy link
Copy Markdown

This pull request has conflicts ☹
Please resolve those so we can review the pull request.
Thanks.

@github-actions github-actions Bot added the status:conflicts Conflicts with another pull request or issue label Dec 19, 2022
@ghost ghost mentioned this pull request Mar 21, 2023
@github-actions github-actions Bot removed the status:conflicts Conflicts with another pull request or issue label Apr 20, 2023
@github-actions
Copy link
Copy Markdown

This pull request is deployed at test.editor.opencast.org/895/2023-04-20_11-55-32/ .
It might take a few minutes for it to become available.

@lkiesow lkiesow merged commit 8b6fd6f into opencast:main Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants