@@ -220,7 +220,7 @@ export const addProps = (
220
220
checkArguments ( 'addProps' , [ children , callback , options ] , [ 'array' , 'function' , 'object' ] )
221
221
}
222
222
223
- return replaceChildren ( children , ( vnode ) => {
223
+ return replaceChildrenInternal ( children , ( vnode ) => {
224
224
const props = callback ( vnode )
225
225
226
226
if ( DEV ) {
@@ -246,14 +246,22 @@ export const replaceChildren = (
246
246
checkArguments ( 'replaceChildren' , [ children , callback , options ] , [ 'array' , 'function' , 'object' ] )
247
247
}
248
248
249
+ return replaceChildrenInternal ( children , callback , options )
250
+ }
251
+
252
+ const replaceChildrenInternal = (
253
+ children : VNodeArrayChildren ,
254
+ callback : ( vnode : VNode ) => ( VNode | VNodeArrayChildren | string | number | void ) ,
255
+ options : IterationOptions
256
+ ) : VNodeArrayChildren => {
249
257
let nc : VNodeArrayChildren | null = null
250
258
251
259
for ( let index = 0 ; index < children . length ; ++ index ) {
252
260
const child = children [ index ]
253
261
254
262
if ( isFragment ( child ) ) {
255
263
const oldFragmentChildren = getFragmentChildren ( child )
256
- const newFragmentChildren = replaceChildren ( oldFragmentChildren , callback , options )
264
+ const newFragmentChildren = replaceChildrenInternal ( oldFragmentChildren , callback , options )
257
265
258
266
let newChild : VNodeChild = child
259
267
@@ -313,7 +321,7 @@ export const betweenChildren = (
313
321
314
322
let previousVNode : VNode | null = null
315
323
316
- return replaceChildren ( children , vnode => {
324
+ return replaceChildrenInternal ( children , vnode => {
317
325
let insertedNodes : VNode | VNodeArrayChildren | string | number | void = undefined
318
326
319
327
if ( previousVNode ) {
0 commit comments