| 4 | export const hotRenderWithHooks = ReactDOM.hotRenderWithHooks || ((fiber, render) => render()); |
| 5 | |
| 6 | function pushStack(stack, node) { |
| 7 | stack.type = node.type; |
| 8 | stack.elementType = node.elementType || node.type; |
| 9 | stack.children = []; |
| 10 | stack.instance = typeof node.type === 'function' ? node.stateNode : stack; |
| 11 | stack.fiber = node; |
| 12 | |
| 13 | if (!stack.instance) { |
| 14 | stack.instance = { |
| 15 | SFC_fake: stack.type, |
| 16 | props: {}, |
| 17 | render: () => hotRenderWithHooks(node, () => stack.type(stack.instance.props)), |
| 18 | }; |
| 19 | } |
| 20 | } |
| 21 | |
| 22 | function hydrateFiberStack(node, stack) { |
| 23 | pushStack(stack, node); |