S0005: unknown event in feedback clause
Generated from rellum-diagnostics/src/db.rs.
Explanation
~ feedback clauses can react only to event bindings declared in the reactive graph. If an on-clause names something that is not an event, the compiler cannot know when that state update should run.
Common causes
- misspelling an event name in an on-clause
- using a derived value or state binding where an event name is required
- declaring the event in a module where reactive bindings are not visible
Canonical fixes
- name an existing event in the feedback clause
Before:
count ~ feedback(
on pres => count + 1,
0
)
After:
press = event(button!())
count ~ feedback(
on press => count + 1,
0
)
- declare the event before using it in feedback
Code example
count ~ feedback(
on pres => count + 1,
0
)