From 2d9334d35f2d8bdfc3e4bd0025660ab14a6b7787 Mon Sep 17 00:00:00 2001 From: yangdx Date: Sun, 12 Oct 2025 01:17:37 +0800 Subject: [PATCH] Simplify Root component by removing async i18n initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Remove useState and useEffect hooks • Import i18n directly instead of async init • Eliminate loading state check --- lightrag_webui/src/components/Root.tsx | 29 +++++++------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/lightrag_webui/src/components/Root.tsx b/lightrag_webui/src/components/Root.tsx index 6191ace8..1129e093 100644 --- a/lightrag_webui/src/components/Root.tsx +++ b/lightrag_webui/src/components/Root.tsx @@ -1,24 +1,9 @@ -import { StrictMode, useEffect, useState } from 'react' -import { initializeI18n } from '@/i18n' +import { StrictMode } from 'react' import App from '@/App' +import '@/i18n' -export const Root = () => { - const [isI18nInitialized, setIsI18nInitialized] = useState(false) - - useEffect(() => { - // Initialize i18n immediately with persisted language - initializeI18n().then(() => { - setIsI18nInitialized(true) - }) - }, []) - - if (!isI18nInitialized) { - return null // or a loading spinner - } - - return ( - - - - ) -} +export const Root = () => ( + + + +)