From d6a8fcc749aeb224de380d30c2150f8bc03588fd Mon Sep 17 00:00:00 2001 From: Joshua Carter Date: Thu, 5 Jan 2023 21:31:15 -0800 Subject: [PATCH] Add support for React 17 and 18 (fiber key changed) Fixes #14 --- react-dom-instance.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/react-dom-instance.js b/react-dom-instance.js index bac5309..2c21426 100644 --- a/react-dom-instance.js +++ b/react-dom-instance.js @@ -28,7 +28,8 @@ function getFiberFromNode(node) { function getFiberKey(node) { return Object.keys(node).find(key => ( - key.startsWith('__reactInternalInstance$') + key.startsWith('__reactInternalInstance$') || + key.startsWith('__reactFiber$') )); } @@ -88,4 +89,4 @@ function warn( msg ){ } module.exports.findInstance = findInstance; -module.exports = {findInstance}; \ No newline at end of file +module.exports = {findInstance};