diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/stubs/stubs.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/stubs/stubs.cpp index 22e7b6c07f6..168040b7eae 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/stubs/stubs.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/stubs/stubs.cpp @@ -83,8 +83,8 @@ StubViewTree buildStubViewTreeWithoutUsingDifferentiator( sliceChildShadowNodeViewPairs(rootShadowNodePair, scope, false, {}, {})); auto emptyRootShadowNode = rootShadowNode.clone(ShadowNodeFragment{ - ShadowNodeFragment::propsPlaceholder(), - ShadowNode::emptySharedShadowNodeSharedList()}); + .props = ShadowNodeFragment::propsPlaceholder(), + .children = ShadowNode::emptySharedShadowNodeSharedList()}); auto stubViewTree = StubViewTree(ShadowView(*emptyRootShadowNode)); stubViewTree.mutate(mutations); @@ -94,8 +94,8 @@ StubViewTree buildStubViewTreeWithoutUsingDifferentiator( StubViewTree buildStubViewTreeUsingDifferentiator( const ShadowNode& rootShadowNode) { auto emptyRootShadowNode = rootShadowNode.clone(ShadowNodeFragment{ - ShadowNodeFragment::propsPlaceholder(), - ShadowNode::emptySharedShadowNodeSharedList()}); + .props = ShadowNodeFragment::propsPlaceholder(), + .children = ShadowNode::emptySharedShadowNodeSharedList()}); auto mutations = calculateShadowViewMutations(*emptyRootShadowNode, rootShadowNode); diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/tests/OrderIndexTest.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/tests/OrderIndexTest.cpp index c53b8b5db04..3196a12487e 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/tests/OrderIndexTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/tests/OrderIndexTest.cpp @@ -84,7 +84,8 @@ class OrderIndexTest : public ::testing::Test { node->getFamily(), [&](const ShadowNode& oldShadowNode) { auto viewProps = std::make_shared(); callback(*viewProps); - return oldShadowNode.clone(ShadowNodeFragment{viewProps}); + return oldShadowNode.clone( + ShadowNodeFragment{.props = viewProps}); })); } diff --git a/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp b/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp index 24cb706ca23..d599438fca0 100644 --- a/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/mounting/tests/ShadowTreeLifeCycleTest.cpp @@ -35,8 +35,10 @@ static void testShadowNodeTreeLifeCycle( auto eventDispatcher = EventDispatcher::Shared{}; auto contextContainer = std::make_shared(); - auto componentDescriptorParameters = - ComponentDescriptorParameters{eventDispatcher, contextContainer, nullptr}; + auto componentDescriptorParameters = ComponentDescriptorParameters{ + .eventDispatcher = eventDispatcher, + .contextContainer = contextContainer, + .flavor = nullptr}; auto viewComponentDescriptor = ViewComponentDescriptor(componentDescriptorParameters); auto rootComponentDescriptor = @@ -49,21 +51,26 @@ static void testShadowNodeTreeLifeCycle( for (int i = 0; i < repeats; i++) { allNodes.clear(); - auto family = - rootComponentDescriptor.createFamily({Tag(1), SurfaceId(1), nullptr}); + auto family = rootComponentDescriptor.createFamily( + {.tag = Tag(1), .surfaceId = SurfaceId(1), .instanceHandle = nullptr}); // Creating an initial root shadow node. auto emptyRootNode = std::const_pointer_cast( std::static_pointer_cast( rootComponentDescriptor.createShadowNode( - ShadowNodeFragment{RootShadowNode::defaultSharedProps()}, + ShadowNodeFragment{ + .props = RootShadowNode::defaultSharedProps()}, family))); // Applying size constraints. emptyRootNode = emptyRootNode->clone( parserContext, LayoutConstraints{ - Size{512, 0}, Size{512, std::numeric_limits::infinity()}}, + .minimumSize = Size{.width = 512, .height = 0}, + .maximumSize = + Size{ + .width = 512, + .height = std::numeric_limits::infinity()}}, LayoutContext{}); // Generation of a random tree. @@ -73,8 +80,9 @@ static void testShadowNodeTreeLifeCycle( // Injecting a tree into the root node. auto currentRootNode = std::static_pointer_cast( emptyRootNode->ShadowNode::clone(ShadowNodeFragment{ - ShadowNodeFragment::propsPlaceholder(), - std::make_shared>>( + .props = ShadowNodeFragment::propsPlaceholder(), + .children = std::make_shared< + std::vector>>( std::vector>{ singleRootChildNode})})); @@ -184,8 +192,10 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening( auto eventDispatcher = EventDispatcher::Shared{}; auto contextContainer = std::make_shared(); - auto componentDescriptorParameters = - ComponentDescriptorParameters{eventDispatcher, contextContainer, nullptr}; + auto componentDescriptorParameters = ComponentDescriptorParameters{ + .eventDispatcher = eventDispatcher, + .contextContainer = contextContainer, + .flavor = nullptr}; auto viewComponentDescriptor = ViewComponentDescriptor(componentDescriptorParameters); auto rootComponentDescriptor = @@ -198,21 +208,26 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening( for (int i = 0; i < repeats; i++) { allNodes.clear(); - auto family = - rootComponentDescriptor.createFamily({Tag(1), SurfaceId(1), nullptr}); + auto family = rootComponentDescriptor.createFamily( + {.tag = Tag(1), .surfaceId = SurfaceId(1), .instanceHandle = nullptr}); // Creating an initial root shadow node. auto emptyRootNode = std::const_pointer_cast( std::static_pointer_cast( rootComponentDescriptor.createShadowNode( - ShadowNodeFragment{RootShadowNode::defaultSharedProps()}, + ShadowNodeFragment{ + .props = RootShadowNode::defaultSharedProps()}, family))); // Applying size constraints. emptyRootNode = emptyRootNode->clone( parserContext, LayoutConstraints{ - Size{512, 0}, Size{512, std::numeric_limits::infinity()}}, + .minimumSize = Size{.width = 512, .height = 0}, + .maximumSize = + Size{ + .width = 512, + .height = std::numeric_limits::infinity()}}, LayoutContext{}); // Generation of a random tree. @@ -222,8 +237,9 @@ static void testShadowNodeTreeLifeCycleExtensiveFlatteningUnflattening( // Injecting a tree into the root node. auto currentRootNode = std::static_pointer_cast( emptyRootNode->ShadowNode::clone(ShadowNodeFragment{ - ShadowNodeFragment::propsPlaceholder(), - std::make_shared>>( + .props = ShadowNodeFragment::propsPlaceholder(), + .children = std::make_shared< + std::vector>>( std::vector>{ singleRootChildNode})}));