Skip to content

Allow anchor to be passed in initial component instantiation #784

@amwmedia

Description

@amwmedia

Hi, just started using svelte and I'm really liking it so far!

What do you think about allowing the initial config object to contain an anchor attribute so the component could be bootstrapped at a particular place in the dom?

In practice it would look something like this:

const target = document.querySelector('main');
const anchor = target.getElementById('somechild');
const app = new App({
	target,
	anchor,
	data: { name: 'yo yo' }
});

I have this working in my fork, the change is incredibly small.

Thanks!

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