@@ -329,7 +329,7 @@ jsi::Value UIManagerBinding::get(
329
329
330
330
// Semantic: Clones the node with *same* props and *empty* children.
331
331
if (methodName == " cloneNodeWithNewChildren" ) {
332
- auto paramCount = 1 ;
332
+ auto paramCount = 2 ;
333
333
return jsi::Function::createFromHostFunction (
334
334
runtime,
335
335
name,
@@ -345,7 +345,8 @@ jsi::Value UIManagerBinding::get(
345
345
runtime,
346
346
uiManager->cloneNode (
347
347
*shadowNodeFromValue (runtime, arguments[0 ]),
348
- ShadowNode::emptySharedShadowNodeSharedList ()));
348
+ count > 1 ? shadowNodeListFromValue (runtime, arguments[1 ])
349
+ : ShadowNode::emptySharedShadowNodeSharedList ()));
349
350
});
350
351
}
351
352
@@ -363,7 +364,7 @@ jsi::Value UIManagerBinding::get(
363
364
size_t count) -> jsi::Value {
364
365
validateArgumentCount (runtime, methodName, paramCount, count);
365
366
366
- const auto & rawProps = RawProps (runtime, arguments[1 ]);
367
+ RawProps rawProps (runtime, arguments[1 ]);
367
368
return valueFromShadowNode (
368
369
runtime,
369
370
uiManager->cloneNode (
@@ -375,7 +376,7 @@ jsi::Value UIManagerBinding::get(
375
376
376
377
// Semantic: Clones the node with *given* props and *empty* children.
377
378
if (methodName == " cloneNodeWithNewChildrenAndProps" ) {
378
- auto paramCount = 2 ;
379
+ auto paramCount = 3 ;
379
380
return jsi::Function::createFromHostFunction (
380
381
runtime,
381
382
name,
@@ -387,12 +388,16 @@ jsi::Value UIManagerBinding::get(
387
388
size_t count) -> jsi::Value {
388
389
validateArgumentCount (runtime, methodName, paramCount, count);
389
390
390
- const auto & rawProps = RawProps (runtime, arguments[1 ]);
391
+ bool hasChildrenArg = count == 3 ;
392
+
393
+ RawProps rawProps (runtime, arguments[hasChildrenArg ? 2 : 1 ]);
391
394
return valueFromShadowNode (
392
395
runtime,
393
396
uiManager->cloneNode (
394
397
*shadowNodeFromValue (runtime, arguments[0 ]),
395
- ShadowNode::emptySharedShadowNodeSharedList (),
398
+ hasChildrenArg
399
+ ? shadowNodeListFromValue (runtime, arguments[1 ])
400
+ : ShadowNode::emptySharedShadowNodeSharedList (),
396
401
&rawProps));
397
402
});
398
403
}
@@ -417,6 +422,7 @@ jsi::Value UIManagerBinding::get(
417
422
});
418
423
}
419
424
425
+ // TODO: remove when passChildrenWhenCloningPersistedNodes is rolled out
420
426
if (methodName == " createChildSet" ) {
421
427
return jsi::Function::createFromHostFunction (
422
428
runtime,
@@ -432,6 +438,7 @@ jsi::Value UIManagerBinding::get(
432
438
});
433
439
}
434
440
441
+ // TODO: remove when passChildrenWhenCloningPersistedNodes is rolled out
435
442
if (methodName == " appendChildToSet" ) {
436
443
auto paramCount = 2 ;
437
444
return jsi::Function::createFromHostFunction (
@@ -475,17 +482,13 @@ jsi::Value UIManagerBinding::get(
475
482
if (!uiManager->backgroundExecutor_ ||
476
483
(runtimeSchedulerBinding &&
477
484
runtimeSchedulerBinding->getIsSynchronous ())) {
478
- auto weakShadowNodeList =
479
- weakShadowNodeListFromValue (runtime, arguments[1 ]);
480
485
auto shadowNodeList =
481
- shadowNodeListFromWeakList (weakShadowNodeList);
482
- if (shadowNodeList) {
483
- uiManager->completeSurface (
484
- surfaceId,
485
- shadowNodeList,
486
- {/* .enableStateReconciliation = */ true ,
487
- /* .mountSynchronously = */ false });
488
- }
486
+ shadowNodeListFromValue (runtime, arguments[1 ]);
487
+ uiManager->completeSurface (
488
+ surfaceId,
489
+ shadowNodeList,
490
+ {/* .enableStateReconciliation = */ true ,
491
+ /* .mountSynchronously = */ false });
489
492
} else {
490
493
auto weakShadowNodeList =
491
494
weakShadowNodeListFromValue (runtime, arguments[1 ]);
0 commit comments