Skip to content

<:Component> Inside other tag mount to null #993

@antonheryanto

Description

@antonheryanto

Hi, thank for such wonderful project

just stumble upon Dynamic component bugs.
provided REPL of bug

when <:Component> inside other

<div>
<:Component {view}></:Component>
</div>

switching to other type causing null error as compiled code mount to null.parentNode

m: function mount(target, anchor) {
    insertNode(h1, target, anchor);
    insertNode(text_1, target, anchor);
    insertNode(div, target, anchor);
    if (switch_instance) switch_instance._mount(div, null);
},

p: function update(changed, state) {
    if (switch_value !== (switch_value = state.view)) {
        if (switch_instance) switch_instance.destroy();

        if (switch_value) {
            switch_instance = new switch_value(switch_props(state));
            switch_instance._fragment.c();
            switch_instance._mount(null.parentNode, null);
        }
    }
},

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions