MCPcopy Create free account
hub / github.com/gaearon/react-hot-loader / getReactStack

Function getReactStack

src/internal/getReactStack.js:9–27  ·  view source on GitHub ↗
(instance)

Source from the content-addressed store, hash-verified

7import { resolveType } from '../reconciler/resolver';
8
9function getReactStack(instance) {
10 const rootNode = getInternalInstance(instance);
11 const stack = {};
12 if (rootNode) {
13 // React stack
14 const isFiber = typeof rootNode.tag === 'number';
15 if (isFiber) {
16 hydrateFiberStack(rootNode, stack);
17 } else {
18 hydrateLegacyStack(rootNode, stack);
19 }
20 } else {
21 // Non-React stack
22 // preact? // inferno?
23 // there is no known VDOM to get stack from
24 }
25
26 return stack;
27}
28
29const markUpdate = ({ fiber }) => {
30 // do not update what we should not

Callers 3

DivFunction · 0.85
reconcileHotReplacementFunction · 0.85

Calls 3

getInternalInstanceFunction · 0.90
hydrateFiberStackFunction · 0.85
hydrateLegacyStackFunction · 0.85

Tested by 1

DivFunction · 0.68