Skip to content

Commit 0ca146b

Browse files
committed
fix: remove react warning about key
1 parent 20895fd commit 0ca146b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/HeTree.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ export function useHeTree<T extends Record<string, any>>(
640640
let renderNodeBox = props.renderNodeBox!
641641
if (!renderNodeBox) {
642642
const placeholder = <div className="he-tree-drag-placeholder" style={{ minHeight: '20px', border: '1px dashed blue' }}></div>
643-
renderNodeBox = ({ stat, attrs, isPlaceholder }) => <div {...attrs}>
643+
renderNodeBox = ({ stat, attrs, isPlaceholder }) => <div {...attrs} key={attrs.key}>
644644
{isPlaceholder ? placeholder : props.renderNode!(stat)}
645645
</div>
646646
}

0 commit comments

Comments
 (0)