/// import { Cell, Default, handler, recipe, UI } from "commontools"; declare global { namespace JSX { interface IntrinsicElements { "ct-button": any; } } } const handleClick = handler }>( (_, { count }) => { count.set(count.get() + 1); }, ); export default recipe<{ count: Default }>( "Event Handler Test", ({ count }) => { return { [UI]: (
{/* Regular JSX expression - should be wrapped in derive */} Count: {count + 1} {/* Event handler with OpaqueRef - should NOT be wrapped in derive */} Click me {/* Event handler inside map - should NOT be wrapped in derive */} {[1, 2, 3].map((n) => ( Button {n} ))}
), count, }; }, );