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

clarify svelte:component migration, avoids common gotcha #543

Closed
wants to merge 2 commits into from

Conversation

rgon
Copy link

@rgon rgon commented Oct 22, 2024

Clarify docs to specify that, while svelte:component is no longer needed and deprecated, capitalizing the component variable name is required to avoid mismatching types.

Avoids users doing the same gotcha that I stumbled upon, it will be a common oversight when refactoring existing codebases: sveltejs/svelte#13795

As evidenced in these docs themselves (corrected):

...
	let component: Component<{ foo: string }> = $state(
		Math.random() ? ComponentA : ComponentB
	);
</script>

<svelte:component this={component} foo="bar" />

Copy link

vercel bot commented Oct 22, 2024

Someone is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

@benmccann
Copy link
Member

@dummdidumm
Copy link
Member

Thank you - as Ben points out, the change should happen in the svelte repo, which will eventually be synced in here

@dummdidumm dummdidumm closed this Oct 23, 2024
@dummdidumm dummdidumm reopened this Oct 23, 2024
@dummdidumm dummdidumm closed this Oct 23, 2024
@rgon
Copy link
Author

rgon commented Oct 23, 2024

Thanks, moved to sveltejs/svelte#13835

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 this pull request may close these issues.

3 participants