-
Notifications
You must be signed in to change notification settings - Fork 488
Description
Is there an existing issue for this?
- I have searched the existing issues
What happened?
Description
React reports duplicate key values when rendering face clusters in the AI-tagging section. Since React relies on unique keys to correctly track component identity, this may lead to unstable UI behavior or unexpected rendering issues.
Location
/src/components/FaceCollections.tsx
Console Warning
Encountered two children with the same key, `xxxxx`.
Keys should be unique so that components maintain their identity across updates.
Screenshot
Steps to Reproduce
- Navigate to the AI-Tagging section
- Load the face clusters
- Open the browser console
- Observe the React warnings about duplicate keys
Expected Behavior
Each rendered list item should have a unique and stable key value.
Actual Behavior
React logs warnings about duplicate key props when rendering cluster items. This may cause components to render incorrectly or lose their identity across updates.
Possible Cause
The key prop appears to be generated from a value that is not guaranteed to be unique or stable across the list.
Suggested Fix
Ensure the key is always unique. For example:
{ clusters.map((cluster: any, i: number) => (
<div key={`${cluster.cluster_id}-${i}`}>Alternatively, if cluster_id is guaranteed unique, it can be used directly.
Environment
- Browser:
- OS:
- App version / commit hash:
Additional Context
I’d be happy to help test or submit a PR for this fix.
Record
- I agree to follow this project's Code of Conduct