TX005

アンマウント後のレンダリング

コンソール

Text.js error TX005: Cannot render into an unmounted console root.

発生原因

root.unmount() の後に、コンソールルートで root.render() が呼び出されました。アンマウントされたルートは、レンダラーと入力リスナーを解放済みです。

修正方法

新しいルートを作成するか、ルートをマウントしたまま別のツリーをレンダリングします。

root.unmount();const next = await createConsoleRoot();next.render(<App />);

テストでは、非同期コールバックからレンダリングする前に root.unmounted を確認します。