src/utils - Add getRootFiberNodeFromDOM helper

To find root Fiber node from overall html document or a particular element.
Ideally, this should be called with the same container element used in ReactDom.render.
This commit is contained in:
2019-08-08 11:51:33 +05:30
parent f94f7c5409
commit 05489aad2c
2 changed files with 44 additions and 2 deletions
+8
View File
@@ -1,5 +1,13 @@
import * as React from "react";
export interface FiberNodeDOMContainer extends Element {
_reactRootContainer: {
_internalRoot: {
current: FiberNode | null;
};
};
}
export type FiberNode =
| FiberNodeForComponentClass
| FiberNodeForFunctionComponent