Ejemplo n.º 1
0
        /// <summary>
        /// Handles a setChildren call. This is a simplification of <see cref="HandleManageChildren(ReactShadowNode, int[], int[], ViewAtIndex[], int[])"/>
        /// that only adds children in index order of the <paramref name="childrenTags"/>
        /// array.
        /// </summary>
        /// <param name="nodeToManage">The node to manage.</param>
        /// <param name="childrenTags">The children tags.</param>
        public void HandleSetChildren(ReactShadowNode nodeToManage, int[] childrenTags)
        {
#if DISABLE_NATIVE_VIEW_HIERARCHY_OPTIMIZER
            _uiViewOperationQueue.EnqueueSetChildren(
                nodeToManage.ReactTag,
                childrenTags);
#else
            for (var i = 0; i < childrenTags.Length; ++i)
            {
                var nodeToAdd = _shadowNodeRegistry.GetNode(childrenTags[i]);
                AddNodeToNode(nodeToManage, nodeToAdd, i);
            }
#endif
        }