Unreachable code

This commit is contained in:
Jiiks 2018-03-17 13:21:08 -03:00
parent 549275e5dc
commit 0820735fa2
1 changed files with 3 additions and 6 deletions

View File

@ -90,11 +90,13 @@ class Reflection {
} }
static getComponent(node, first = true) { static getComponent(node, first = true) {
// IMPORTANT TODO Currently only checks the first found component. For example channel-member will not return the correct component
try { try {
return this.reactInternalInstance(node).return.type; return this.reactInternalInstance(node).return.type;
} catch (err) { } catch (err) {
return null; return null;
} }
/*
if (!node) return null; if (!node) return null;
if (first) node = this.reactInternalInstance(node); if (first) node = this.reactInternalInstance(node);
if (node.hasOwnProperty('return')) { if (node.hasOwnProperty('return')) {
@ -103,12 +105,7 @@ class Reflection {
} }
if (node.hasOwnProperty('type')) return node.type; if (node.hasOwnProperty('type')) return node.type;
return null; return null;
// IMPORTANT TODO Currently only checks the first found component. For example channel-member will not return the correct component */
try {
return this.reactInternalInstance(node).return.type;
} catch (err) {
return null;
}
} }
} }