Nikatlas 5 年之前
父節點
當前提交
f9cf45eaa1
共有 2 個文件被更改,包括 5 次插入8 次删除
  1. 0 0
      dist/lib/systems/CoreSystem.js
  2. 5 8
      lib/systems/CoreSystem.js

File diff suppressed because it is too large
+ 0 - 0
dist/lib/systems/CoreSystem.js


+ 5 - 8
lib/systems/CoreSystem.js

@@ -91,13 +91,10 @@ export default class CoreSystem {
 		let targets = event.path.map(item => findReactElement(item));
 		let resViewNode = null;
 		for (var i in targets) {
-			if(targets[i] !== null){
-				if(targets[i].props && targets[i].props.ID) {
-					resViewNode = targets[i].props.ID;
-					break;
-				}
-			}
-			
+			if(targets[i] && targets[i].ID) {
+				resViewNode = targets[i].ID;
+				break;
+			}		
 		}
 		let ViewID = this.Routing.getCurrentView();
 		return this.ViewSystem.getNode(ViewID, resViewNode);
@@ -113,7 +110,7 @@ export default class CoreSystem {
 const findReactElement = (node) => {
     for (var key in node) {
         if (key.startsWith("__reactInternalInstance$")) {
-            return (node[key]._debugOwner && node[key]._debugOwner.stateNode) || (node[key].stateNode);
+            return (node[key]._debugOwner && node[key]._debugOwner.stateNode.props) || (node[key].stateNode.memoizedProps);
         }
     }
     return null;

Some files were not shown because too many files changed in this diff