Leo il y a 2 ans
Parent
commit
2ab1517cea
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      src/module/datasource/component/DatasourceData.jsx

+ 3 - 1
src/module/datasource/component/DatasourceData.jsx

@@ -56,7 +56,9 @@ const DatasourceData = props => {
   }, [data])
 
   useEffect(() => {
-    onSelect(treeData[0]?.key)
+    if (treeData[0]) {
+      onSelect(treeData[0].key)
+    }
   }, [treeData])
 
   const onSelect = selectedKeys => {