2222var ReactComponent = require ( 'ReactComponent' ) ;
2323var ReactMultiChildUpdateTypes = require ( 'ReactMultiChildUpdateTypes' ) ;
2424
25+ var flattenChildren = require ( 'flattenChildren' ) ;
26+
2527/**
2628 * Given a `curChild` and `newChild`, determines if `curChild` should be
2729 * updated as opposed to being destroyed or replaced.
@@ -190,11 +192,12 @@ var ReactMultiChild = {
190192 * Generates a "mount image" for each of the supplied children. In the case
191193 * of `ReactDOMComponent`, a mount image is a string of markup.
192194 *
193- * @param {?object } children As returned by `flattenChildren` .
195+ * @param {?object } nestedChildren Nested child maps .
194196 * @return {array } An array of mounted representations.
195197 * @internal
196198 */
197- mountChildren : function ( children , transaction ) {
199+ mountChildren : function ( nestedChildren , transaction ) {
200+ var children = flattenChildren ( nestedChildren ) ;
198201 var mountImages = [ ] ;
199202 var index = 0 ;
200203 this . _renderedChildren = children ;
@@ -248,14 +251,14 @@ var ReactMultiChild = {
248251 /**
249252 * Updates the rendered children with new children.
250253 *
251- * @param {?object } nextChildren As returned by `flattenChildren` .
254+ * @param {?object } nextNestedChildren Nested child maps .
252255 * @param {ReactReconcileTransaction } transaction
253256 * @internal
254257 */
255- updateChildren : function ( nextChildren , transaction ) {
258+ updateChildren : function ( nextNestedChildren , transaction ) {
256259 updateDepth ++ ;
257260 try {
258- this . _updateChildren ( nextChildren , transaction ) ;
261+ this . _updateChildren ( nextNestedChildren , transaction ) ;
259262 } catch ( error ) {
260263 updateDepth -- ;
261264 updateDepth || clearQueue ( ) ;
@@ -269,12 +272,13 @@ var ReactMultiChild = {
269272 * Improve performance by isolating this hot code path from the try/catch
270273 * block in `updateChildren`.
271274 *
272- * @param {?object } nextChildren As returned by `flattenChildren` .
275+ * @param {?object } nextNestedChildren Nested child maps .
273276 * @param {ReactReconcileTransaction } transaction
274277 * @final
275278 * @protected
276279 */
277- _updateChildren : function ( nextChildren , transaction ) {
280+ _updateChildren : function ( nextNestedChildren , transaction ) {
281+ var nextChildren = flattenChildren ( nextNestedChildren ) ;
278282 var prevChildren = this . _renderedChildren ;
279283 if ( ! nextChildren && ! prevChildren ) {
280284 return ;
0 commit comments