-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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] Error bind:value
cannot be used with dynamically mounted components
#13795
Comments
bind:value
cannot be used with dynamically mounted componentsbind:value
cannot be used with dynamically mounted components
Hello, The problem come from the name of your props : The variable for component must start with an uppercase. let {
chosenInput : ChosenInput
} = $props(); |
@adiguba I just found out and was editing this issue to be a documentation one. Thank you anyways! I think the docs should reflect that in the migration guide, since when migrating from Are you aware if this is mentioned somewhere else? It surely deserves a page in the docs. |
Closing this issue and opening related one in sveltejs/svelte.dev |
…t to 5 syntax, as seen in sveltejs/svelte/issues/13795
…t to 5 syntax, as seen in sveltejs/svelte/issues/13795
…t to 5 syntax, as seen in sveltejs/svelte/issues/13795
Describe the bug
When defining a child with a
$bindable
prop namedvalue
(which is quite ergonomic on custom inputs):If we create a component that dynamically mounts it, when given as a parameter (new
svelte:component
),We will get the error:
This shouldn't be the case, since we very clearly can
bind:value
if such bindable property exists (REPL)Reproduction
Error REPL
Workaround:
For some reason, it does work if the
Component
we're initializing is anobject
's member, so we can wrap it with{@const}
: Workaround REPLNote that, since this is not a
language-tools
error/warning, we cannot fix it with a type definition that includesvalue
as a bindable. The runtime error does not go away:Logs
No response
System Info
Severity
annoyance, have found a workaround
The text was updated successfully, but these errors were encountered: