Why this fires¶
TE741 reports an unsupported two-way DOM binding or a binding whose known source type is incompatible with the DOM property.
fn field(checked: str) -> View {
<input type="checkbox" bind:checked={checked} aria-label="done" />
}
// error[TE741]: bind:checked expects bool, but checked is strFix it¶
Choose a binding offered for that element and bind it to a writable value of the displayed type. The short form bind:value targets the lexical value binding.
For <input>, bind:value follows the authored control type:
var<signal> price = 30
var<signal> query = ""
<input type="number" bind:value={price} aria-label="Price" /> // writes a number
<input type="text" bind:value={query} aria-label="Search" /> // writes texttype="number" and type="range" accept numeric cells. Textual input types, including the default when type is omitted, accept str cells.