Re-add try/catch inside Agent's getIDForNode()

This commit is contained in:
Brian Vaughn
2019-07-28 08:42:21 -07:00
parent 82881ab261
commit 8e2134beee
+8 -4
View File
@@ -189,10 +189,14 @@ export default class Agent extends EventEmitter<{|
(rendererID: any)
]: any): RendererInterface);
const id = renderer.getFiberIDForNative(node, true);
if (id !== null) {
return id;
try {
const id = renderer.getFiberIDForNative(node, true);
if (id !== null) {
return id;
}
} catch (error) {
// Some old React versions might throw if they can't find a match.
// If so we should ignore it...
}
}
return null;