Skip to content

Replace target instead of appending to it #1549

@tarjei

Description

@tarjei

Hi, when I do new MyComponent({target: document.getElementById('someId')}) then the new component gets added to the element instead of replacing it.

I would love to have a way to replace the target, f.x new MyComponent({target: document.getElementById('someId'), replace: true}). This would give my users a better experience in situations where I'm adding Svelte components to content that they already see in their browser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions