The markup writes to state
The message
MARKLESS_STATE_WRITE_IN_TEMPLATE: Cannot write state inside a template expression
DOM updates are the only effects in the demand-driven graph; a write inside a branch test creates a self-waking cycle that cannot resume.
Render the value directly and move the mutation to an event handler or another explicit write site.
https://markless.dev/errors/MARKLESS_STATE_WRITE_IN_TEMPLATEWhy
Expressions in markup only read values. This one also writes to state, and the write wakes the same expression again.
Fix
Render the value directly. Move the write into an event handler.