Skip to content

Commit 75ad94e

Browse files
fix(FormItem): fix react unique key error when using multiple children in FormItem (#4509)
fixes #4499
1 parent 67fc863 commit 75ad94e

File tree

1 file changed

+1
-1
lines changed
  • packages/main/src/components/FormItem

1 file changed

+1
-1
lines changed

packages/main/src/components/FormItem/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ const FormItem = (props: FormItemPropTypes) => {
158158
const content = getContentForHtmlLabel(label);
159159
const childId = child?.props?.id;
160160
return (
161-
<Fragment key={`${content}-${uniqueId}`}>
161+
<Fragment key={`${content}-${uniqueId}-${index}`}>
162162
{/*@ts-expect-error: child is ReactElement*/}
163163
{cloneElement(child, { id: childId ?? `${uniqueId}-${index}` })}
164164
<label htmlFor={childId ?? `${uniqueId}-${index}`} style={{ display: 'none' }} aria-hidden={true}>

0 commit comments

Comments
 (0)