C04
Warning
Components
C04 — An attribute a built-in does not declare
A named argument a built-in has no prop for is written to its element as an HTML attribute. aria-*, data-* and the global attributes are expected; anything else is usually a misspelling.
What the compiler said
warning[C04]: Button has no prop `colour`; it is written to the element as an attribute --> src/App.wf:3:20 | 3 | Button("Save", colour: "red") | ^^^^^^ = help: A typo here does nothing on screen; check the component's props = docs: https://webfluent.monzeromer.dev/errors/C04
The fix
Broken
page P(path: "/", title: "T", description: "D") {
Heading("Save").h1
Button("Save", colour: "red")
}
Fixed
page P(path: "/", title: "T", description: "D") {
Heading("Save").h1
Button("Save").danger
}
Check the prop's spelling — wf registry lists what the built-in
takes. aria-*, data-* and the global attributes (id, role,
title, …) are expected and draw nothing.
Each example is a whole program: it is all of src/App.wf in a project with no other .wf file (trying an example).
Why this rule exists
Warning.
lints may lower it:
"lints": { "C04": "off" }
// wf-allow(C04)