From 887f4b95d178e8c3254a57ddade57f0fea29c2c3 Mon Sep 17 00:00:00 2001 From: bendtherules Date: Sat, 10 Aug 2019 10:37:12 +0530 Subject: [PATCH] Modify utils - doesElementContainRootFiberNode also checks for _internalRoot now --- src/utils.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index f275b93..52e90b7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -64,7 +64,12 @@ function isConstructorFunctionComponent( function doesElementContainRootFiberNode( element: Element ): element is FiberNodeDOMContainer { - return element.hasOwnProperty("_reactRootContainer"); + return ( + element.hasOwnProperty("_reactRootContainer") && + (element as (Element & { + _reactRootContainer: any; + }))._reactRootContainer.hasOwnProperty("_internalRoot") + ); } /**