///
import { cell, recipe, UI } from "commontools";
export default recipe("LogicalAndSimpleRef", (_state) => {
const showPanel = cell(true);
const userName = cell("Alice");
return {
[UI]: (
{/* Simple opaque ref with JSX on right - SHOULD use when for short-circuit optimization */}
{showPanel &&
Panel content
}
{/* Another simple ref */}
{userName &&
Hello {userName}}
),
};
});