Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fix) vnode._children should keep their type as array when diffing #1924

Merged
merged 3 commits into from
Sep 13, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/diff/index.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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);
cristianbote marked this conversation as resolved.
Show resolved Hide resolved

if (c.getChildContext!=null) {
context = assign(assign({}, context), c.getChildContext());
Expand Down