V09
Warning
Vocabulary
V09 — An event the element does not fire
A handler names neither a DOM event nor one the element declares, so it never runs; often a misspelling (on clik).
What the compiler said
warning[V09]: `clik` is not an event Button fires --> src/App.wf:3:22 | 3 | Button("Save") { on clik { log("saved") } } | ^^ = help: A handler names a DOM event (`click`, `input`, `change`, `submit`, `keydown`, `pointerdown`, `scroll`, …) or an event the element declares = docs: https://webfluent.monzeromer.dev/errors/V09
Your editor offers this fix: Change to click. wf fix --code V09 applies it to every place it fits.
The fix
Broken
page P(path: "/", title: "T", description: "D") {
Heading("Save").h1
Button("Save") { on clik { log("saved") } }
}
Fixed
page P(path: "/", title: "T", description: "D") {
Heading("Save").h1
Button("Save") { on click { log("saved") } }
}
Name a DOM event (click, input, change, submit, keydown,
…) or one the component declares.
Each example is a whole program: it is all of src/App.wf in a project with no other .wf file (trying an example).
lints may lower it:
"lints": { "V09": "off" }
// wf-allow(V09)