You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rendered DOM contains 5 items instead of 4. React fails to reconcile the list correctly due to duplicate keys, retaining an extra DOM node.
The expected behavior
React should handle the state update and reconciliation correctly, ensuring that the rendered DOM contains only the updated list of items (4 items in this case). Duplicate keys should not lead to unexpected rendering issues.
The text was updated successfully, but these errors were encountered:
Rendering a list with duplicate keys causes unexpected behavior in reconciliation. Not sure if this is a bug or not.
React version: v18.0.0
Steps To Reproduce
Link to code example:
The current behavior
When using either useEffect or useLayoutEffect:
The rendered DOM contains 5 items instead of 4. React fails to reconcile the list correctly due to duplicate keys, retaining an extra DOM node.
The expected behavior
React should handle the state update and reconciliation correctly, ensuring that the rendered DOM contains only the updated list of items (4 items in this case). Duplicate keys should not lead to unexpected rendering issues.
The text was updated successfully, but these errors were encountered: