Error codesEvents

onClick gets a value, not a function

MARKLESS_EVENT_HANDLER_NOT_A_FUNCTIONerrorMarkless raises it while it builds your .tsrx files.

The message

MARKLESS_EVENT_HANDLER_NOT_A_FUNCTION: `<attributeName>={<source>}` passes the result of `<source>`, not a function. The expression would run once while rendering, and the click would receive a number.
An event prop compiles to a lazy handler symbol that runs on the browser event; only a function can be that handler.
Wrap it in a function, for example <attributeName>={() => <source>}.
https://markless.dev/errors/MARKLESS_EVENT_HANDLER_NOT_A_FUNCTION

Words in angle brackets change from case to case.

Why

An event prop needs a function. This one gets the result of an expression, which runs once during render.

Fix

Wrap the expression in an arrow function.

Before

import { state } from '@markless/core';export function Save() @{	let saved = state(false);	<button onClick={(saved = true)}>Save</button>}

After

<button onClick={() => (saved = true)}>Save</button>
Where Markless raises it

All error codes