A handler uses a prop the browser cannot get back
The message
MARKLESS_CAPTURE_OPAQUE_PROP: "<componentName>" <absentAction> its prop "<propName>" in `<absentSource>`<absentAt> without checking that it was passed, and this <<componentName>> passes no "<propName>", so that code would throw when it runs in the browser.
A prop the caller leaves out is undefined. Reading it, or checking it, works; calling it or reading a field of it throws unless the code checks first that it is there.
Read it optionally as <propName>?.…, guard it with if (<propName>) or <propName> ? … : …, or pass <propName> where "<componentName>" is rendered.
MARKLESS_CAPTURE_OPAQUE_PROP: "<componentName>" reads its prop "<propName>" as `<source>` in <lazySymbolRole>, which runs in the browser, but this <<componentName>> passes `<expression>`: code that runs only while the page renders, with no way for the browser to get its value.
A demanded capture slot must route to a graph node, a compiler-known constant, or a callback symbol. Constant data reaches the browser as its build-time value: literals, object and array literals, and static member or index reads of a module `const` in this file or of a plain-data `const` export of an imported module that no statement there writes through. This expression is none of those - a function call, a `let`, a class instance, a namespace import, or a constant its module mutates - so its value exists only when the render runs.
Call it optionally as <propName>?.(…), guard it with if (<propName>), or pass <propName> where "<componentName>" is rendered.
https://markless.dev/errors/MARKLESS_CAPTURE_OPAQUE_PROPWords in angle brackets change from case to case.
Why
An event handler runs in the browser after the page loads, so every prop it uses needs a value the build can hand it there: state, a constant, or a callback the parent passed. A received callback works anywhere, even straight on an element: <button onClick={onPress}> runs the callback this instance was given, with the event, and runs nothing if it was given none. The build stops when the prop is something else, like the result of a function call or a let, or when a handler calls a prop the parent never passes without ?..
Fix
Pass a callback, a literal, or plain constant data, or hold the value in state() in the parent. For a callback the parent may leave out, call it as onPress?.().
function Key({ onPress }: { readonly onPress?: (event: MouseEvent) => void }) @{ <button onClick={onPress}>Go</button>}