diff --git a/src/ui/React/LogBoxManager.tsx b/src/ui/React/LogBoxManager.tsx index 530b6ce20..ca5773f41 100644 --- a/src/ui/React/LogBoxManager.tsx +++ b/src/ui/React/LogBoxManager.tsx @@ -58,6 +58,7 @@ export class LogBoxProperties { this.x = x; this.y = y; this.updateDOM(); + this.rerender(); } setSize(width: number, height: number): void { diff --git a/src/ui/React/hooks.ts b/src/ui/React/hooks.ts index ef1ba37e2..c6baf2500 100644 --- a/src/ui/React/hooks.ts +++ b/src/ui/React/hooks.ts @@ -4,9 +4,9 @@ import { useCallback, useEffect, useState } from "react"; * @param autoRerenderTime: Optional. If provided and nonzero, used as the ms interval to automatically call the rerender function. */ export function useRerender(autoRerenderTime?: number) { - const [__, setRerender] = useState(false); + const [__, setRerender] = useState(0); - const rerender = useCallback(() => setRerender((old) => !old), []); + const rerender = useCallback(() => setRerender((currentValue) => currentValue + 1), []); useEffect(() => { if (!autoRerenderTime) return;