/** * TRANSFORM REPRO: patternized map callback should lower reactive expression statements * * Once `.map(...)` lowers to `.mapWithPattern(...)`, the callback body is pattern-owned. * This bare statement call consumes reactive callback fields and should cross an explicit * compute boundary instead of operating directly on `file.key(...)` refs in plain code. */ import { Default, pattern, UI, VNode, Writable, } from "commonfabric"; interface FileEntry { name: string; type: "file" | "folder"; } interface Input { files: Writable>; } interface Output { [UI]: VNode; } export default pattern(({ files }) => { return { [UI]: (
{files.map((file) => { console.log("mapping", file.name, file.type); return {file.name}; })}
), }; });