You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When dynamically creating components, we can use a spread operator to pass in props. This allows for complete flexibility when defining a schema that renders components dynamically. The same flexibility is expected when binding 2-way props, when defining, for example, a form's control field (for file upload or processing).
{#eachObject.entries(formSchema) as [key, field]}
<h3style="display:inline">{field.title}</h3>
<field.rendererbind:value={formState[key]} bind:control={componentControl[key]} {...field.extraProps}/>
<!-- ^- if field.renderer doesn't export control, the whole program errors out -->
{/each}
Without runes, we could bind to a non-exported/non-existant property without the whole program erroring out REPL, so we could instantiate a component that only
In runes mode, however, if the dynamically loaded component has no bindable control export, we get the bind_not_bindable error: REPL
bind_not_bindable
A component is attempting to bind to a non-bindable property control belonging to InputRenderer.svelte (i.e. <InputRenderer bind:control={...}>). To mark a property as bindable: let { control = $bindable() } = $props()
Should this error be, at most, a warning?
Also, if it cannot be fixed, accessing a component's (by value) exported props, to check if it's set, would at least ease porting existing projects, even if it means duplication of code (as in the WORKAROUND REPL below).
It might not be exactly a bug but I think we can and should fix it...I think we should just warn if it's not in the list of bindable values but it's in the list of props. Will fix tomorrow
Describe the bug
When dynamically creating components, we can use a spread operator to pass in props. This allows for complete flexibility when defining a schema that renders components dynamically. The same flexibility is expected when binding 2-way props, when defining, for example, a form's control field (for file upload or processing).
Without runes, we could bind to a non-exported/non-existant property without the whole program erroring out REPL, so we could instantiate a component that only
or also
In runes mode, however, if the dynamically loaded component has no bindable
control
export, we get thebind_not_bindable
error: REPLShould this error be, at most, a warning?
Also, if it cannot be fixed, accessing a component's (by value) exported props, to check if it's set, would at least ease porting existing projects, even if it means duplication of code (as in the WORKAROUND REPL below).
Reproduction
Error in Runes mode: REPL
WORKAROUND: specify whether each field renderer has the optional
$bindable
property REPLLogs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: