TX005

Render sau khi unmount

Console

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

Nguyên nhân

root.render() đã được gọi trên một console root sau root.unmount(). Root đã unmount đã giải phóng bộ render và các bộ lắng nghe đầu vào.

Cách khắc phục

Tạo root mới, hoặc giữ root ở trạng thái mount và render một cây khác:

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

Trong kiểm thử, kiểm tra root.unmounted trước khi render từ callback bất đồng bộ.