Skip to content

Commit 12992e3

Browse files
committed
Prevent memory leak when component updates and ref changes
1 parent 75cd49a commit 12992e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

resources/scripts/components/server/Console.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default () => {
4545
);
4646

4747
useEffect(() => {
48-
if (ref.current) {
48+
if (ref.current && !terminal.element) {
4949
terminal.open(ref.current);
5050

5151
// @see https://github.com/xtermjs/xterm.js/issues/2265

0 commit comments

Comments
 (0)