diff --git a/src/diff/index.js b/src/diff/index.js index 6adad6b2b5..dec4a0e0ed 100644 --- a/src/diff/index.js +++ b/src/diff/index.js @@ -1,7 +1,7 @@ import { EMPTY_OBJ, EMPTY_ARR } from '../constants'; import { Component, enqueueRender } from '../component'; import { Fragment } from '../create-element'; -import { diffChildren } from './children'; +import { diffChildren, toChildArray } from './children'; import { diffProps } from './props'; import { assign, removeNode } from '../util'; import options from '../options'; @@ -118,7 +118,7 @@ export function diff(parentDom, newVNode, oldVNode, context, isSvg, excessDomChi tmp = c.render(c.props, c.state, c.context); let isTopLevelFragment = tmp != null && tmp.type == Fragment && tmp.key == null; - newVNode._children = isTopLevelFragment ? tmp.props.children : tmp; + newVNode._children = toChildArray(isTopLevelFragment ? tmp.props.children : tmp); if (c.getChildContext!=null) { context = assign(assign({}, context), c.getChildContext());