Skip to content

Commit 8cbb720

Browse files
niktverdNikolay Tverdokhlebov
andauthored
fix: add uniqueness to children key prop (#192)
Co-authored-by: Nikolay Tverdokhlebov <[email protected]>
1 parent d8a7431 commit 8cbb720

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/containers/PageConstructor/components/ConstructorBlocks/ConstructorBlocks.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const ConstructorBlocks = ({items, shouldRenderBlock}: ConstructorBlocksP
3030
let itemElement;
3131
const key = getBlockKey(item, index);
3232
const blockId = parentId ? `${parentId}_${key}` : key;
33-
if (shouldRenderBlock && !shouldRenderBlock(item, key)) {
33+
if (shouldRenderBlock && !shouldRenderBlock(item, blockId)) {
3434
return null;
3535
}
3636

@@ -44,8 +44,8 @@ export const ConstructorBlocks = ({items, shouldRenderBlock}: ConstructorBlocksP
4444
itemElement = (
4545
<ConstructorLoadable
4646
block={item}
47-
key={key}
48-
blockKey={key}
47+
key={blockId}
48+
blockKey={blockId}
4949
config={config}
5050
serviceId={serviceId}
5151
params={params}
@@ -58,7 +58,7 @@ export const ConstructorBlocks = ({items, shouldRenderBlock}: ConstructorBlocksP
5858

5959
itemElement = (
6060
<BlockIdContext.Provider value={blockId}>
61-
<ConstructorItem data={item} key={key}>
61+
<ConstructorItem data={item} key={blockId}>
6262
{children}
6363
</ConstructorItem>
6464
</BlockIdContext.Provider>

0 commit comments

Comments
 (0)