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

Svelte 5: The anchor option is missing in the new mount() #11021

Closed
CrendKing opened this issue Apr 1, 2024 · 0 comments · Fixed by #11050
Closed

Svelte 5: The anchor option is missing in the new mount() #11021

CrendKing opened this issue Apr 1, 2024 · 0 comments · Fixed by #11050
Assignees
Milestone

Comments

@CrendKing
Copy link

CrendKing commented Apr 1, 2024

Describe the problem

I was trying to upgrade my project to Svelte 5. My Svelte 4 code uses the anchor option to specify where a component is placed in the container element. I noticed the option is no longer available in the exported mount() in Svelte 5, even though it still exists in the internal _mount(). Is this intended? What's the recommended way to migrate?

Describe the proposed solution

As a workaround, currently I have to create an empty <div>, prepend to the anchor node, mount the components to the <div>, then anchor.replaceWith(...anchor.children).

Importance

would make my life easier

@Rich-Harris Rich-Harris added this to the 5.0 milestone Apr 1, 2024
@trueadm trueadm self-assigned this Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants