@@ -38,6 +38,8 @@ export function markAttrsAccessed() {
38
38
accessedAttrs = true
39
39
}
40
40
41
+ type SetRootFn = ( ( root : VNode ) => void ) | undefined
42
+
41
43
export function renderComponentRoot (
42
44
instance : ComponentInternalInstance
43
45
) : VNode {
@@ -121,7 +123,7 @@ export function renderComponentRoot(
121
123
// in dev mode, comments are preserved, and it's possible for a template
122
124
// to have comments along side the root element which makes it a fragment
123
125
let root = result
124
- let setRoot : ( ( root : VNode ) => void ) | undefined = undefined
126
+ let setRoot : SetRootFn = undefined
125
127
if (
126
128
__DEV__ &&
127
129
result . patchFlag > 0 &&
@@ -246,9 +248,7 @@ export function renderComponentRoot(
246
248
* template into a fragment root, but we need to locate the single element
247
249
* root for attrs and scope id processing.
248
250
*/
249
- const getChildRoot = (
250
- vnode : VNode
251
- ) : [ VNode , ( ( root : VNode ) => void ) | undefined ] => {
251
+ const getChildRoot = ( vnode : VNode ) : [ VNode , SetRootFn ] => {
252
252
const rawChildren = vnode . children as VNodeArrayChildren
253
253
const dynamicChildren = vnode . dynamicChildren
254
254
const childRoot = filterSingleRoot ( rawChildren )
@@ -257,7 +257,7 @@ const getChildRoot = (
257
257
}
258
258
const index = rawChildren . indexOf ( childRoot )
259
259
const dynamicIndex = dynamicChildren ? dynamicChildren . indexOf ( childRoot ) : - 1
260
- const setRoot = ( updatedRoot : VNode ) => {
260
+ const setRoot : SetRootFn = ( updatedRoot : VNode ) => {
261
261
rawChildren [ index ] = updatedRoot
262
262
if ( dynamicChildren ) {
263
263
if ( dynamicIndex > - 1 ) {
0 commit comments