@@ -15,7 +15,7 @@ import VNode, { createEmptyVNode } from '../vdom/vnode'
1515
1616import { isUpdatingChildComponent } from './lifecycle'
1717import type { Component } from 'types/component'
18- import { setCurrentInstance } from 'v3/currentInstance'
18+ import { currentInstance , setCurrentInstance } from 'v3/currentInstance'
1919import { syncSetupSlots } from 'v3/apiSetup'
2020
2121export function initRender ( vm : Component ) {
@@ -120,11 +120,10 @@ export function renderMixin(Vue: typeof Component) {
120120 // to the data on the placeholder node.
121121 vm . $vnode = _parentVnode !
122122 // render self
123+ const prevInst = currentInstance
124+ const prevRenderInst = currentRenderingInstance
123125 let vnode
124126 try {
125- // There's no need to maintain a stack because all render fns are called
126- // separately from one another. Nested component's render fns are called
127- // when parent component is patched.
128127 setCurrentInstance ( vm )
129128 currentRenderingInstance = vm
130129 vnode = render . call ( vm . _renderProxy , vm . $createElement )
@@ -148,8 +147,8 @@ export function renderMixin(Vue: typeof Component) {
148147 vnode = vm . _vnode
149148 }
150149 } finally {
151- currentRenderingInstance = null
152- setCurrentInstance ( )
150+ currentRenderingInstance = prevRenderInst
151+ setCurrentInstance ( prevInst )
153152 }
154153 // if the returned array contains only a single node, allow it
155154 if ( isArray ( vnode ) && vnode . length === 1 ) {
0 commit comments