From 2f7d587ae8c792034fd31e2ed2e4121b2039f5be Mon Sep 17 00:00:00 2001 From: caiqingzhi2020 Date: Mon, 9 Feb 2026 20:56:26 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9Autils.ts:219=20Z:=20react.developme?= =?UTF-8?q?nt.js:209=20=20Warning:=20Each=20child=20in=20a=20list=20should?= =?UTF-8?q?=20have=20a=20unique=20"key"=20prop.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++++++ src/page/mount/mount.tsx | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d371b4c..3714695 100644 --- a/README.md +++ b/README.md @@ -143,7 +143,14 @@ react-dom.development.js:86 Warning: validateDOMNesting(...):
cannot appe 分析:
不能作为另一个 的后代出现。这是一个嵌套表单的警告,出现在 AddMount_page src/page/mount/add.tsx中,涉及 InputForm_module src/page/other/InputForm.tsx 修复:移除外层 标签,将表单项直接放在容器中 移除外层 标签,用普通
容器包装表单项 +----- +bug ’添加挂载‘页面 点击’挂载‘后报错 +日志 react.development.js:209 Warning: Each child in a list should have a unique "key" prop. +分析 表格数据映射时缺少唯一 key 属性 +修复 +src/page/mount/mount.tsx - 添加了唯一 key 属性 +优化了 mountStorage 调用的异步处理添加 async 并使用 loading 状态优化体验 -----


diff --git a/src/page/mount/mount.tsx b/src/page/mount/mount.tsx index 1185aa0..a613336 100644 --- a/src/page/mount/mount.tsx +++ b/src/page/mount/mount.tsx @@ -124,6 +124,7 @@ function Mount_page() { nmConfig.mount.lists.map((item) => { const mounted = isMounted(item.mountPath) return { + key: item.mountPath, // 添加唯一 key 避免 React 警告 ...item, mountPath_:
{item.mountPath}{rcloneInfo.endpoint.isLocal && osInfo.osType === 'windows' && mounted && - + }