infernojs / inferno

:fire: An extremely fast, React-like JavaScript library for building modern user interfaces

Home Page:https://infernojs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Context assigned to null if component wrapped in Fragment

ivanblinov2k17 opened this issue · comments

Looks like a typo here

function mountFragment(vNode, context, parentDOM, isSVG, nextNode, lifecycle) {
    var children = vNode.children;
    var childFlags = vNode.childFlags;
    // When fragment is optimized for multiple children, check if there is no children and change flag to invalid
    // This is the only normalization always done, to keep optimization flags API same for fragments and regular elements
    if (childFlags & 12 /* MultipleChildren */ && children.length === 0) {
        childFlags = vNode.childFlags = 2 /* HasVNodeChildren */;
        children = vNode.children = createVoidVNode();
    }
    if (childFlags === 2 /* HasVNodeChildren */) {
        mount(children, parentDOM, nextNode, isSVG, nextNode, lifecycle);
    }
    else {
        mountArrayChildren(children, parentDOM, context, isSVG, nextNode, lifecycle);
    }
}

should be

if (childFlags === 2 /* HasVNodeChildren */) {
        mount(children, parentDOM, context, isSVG, nextNode, lifecycle);
}

Yeah, thanks for reporting this issue

This is fixed in 7.4.11