Skip to content

docs: use modern dynamic-component syntax in the {#await} FAQ example#15967

Open
DucMinhNe wants to merge 1 commit into
sveltejs:mainfrom
DucMinhNe:fix/faq-svelte-component-deprecated
Open

docs: use modern dynamic-component syntax in the {#await} FAQ example#15967
DucMinhNe wants to merge 1 commit into
sveltejs:mainfrom
DucMinhNe:fix/faq-svelte-component-deprecated

Conversation

@DucMinhNe
Copy link
Copy Markdown

Summary

The {#await} example in the FAQ entry "How do I use a client-side library accessing document or window?" renders the resolved component with <svelte:component>:

{:then component}
	<svelte:component this={component} />

<svelte:component> is deprecated in Svelte 5 runes mode — components are dynamic by default, so a capitalized variable can be rendered directly. SvelteKit 2 requires Svelte 5, so copying this example emits a deprecation warning.

Change

Render the resolved constructor directly by capitalizing the {:then} binding:

{:then Component}
	<Component />

This is the only <svelte:component> usage left in documentation/docs/. Docs-only change.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 6, 2026

⚠️ No Changeset found

Latest commit: 38ebe63

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@teemingc teemingc added the documentation Improvements or additions to documentation label Jun 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants