`createRoot(renderer).render()` 会通过 `clearContainer` 静默地清除之前的树,从而永久泄露其影响
作者: letrquan创建于 2026年9月24日更新于 2026年9月24日
// repro.tsx -- run with bun repro.tsx
import { createTestRenderer } from "@opentui/core/testing";
import { createRoot } from "@opentui/ZZTERM11ZZ";
import ZZTERM12ZZ, { useEffect } from "ZZTERM13ZZ";
const sleep = (ms: number) => new Promise((r) => setTimeout(r, ms)); let firstTicks = 0;
function Probe({ label, onTick }: { label: string; onTick?: () => void }) { useEffect(() => { const id = setInterval(() => onTick?.(), 100); return () => clearInterval(id); }, …
内容来源: anomalyco/opentui