mirror of
https://github.com/remvze/moodist.git
synced 2025-12-18 01:14:17 +00:00
fix: resolve hydration mismatch error for i18n
This commit is contained in:
parent
0ab31a16f6
commit
c8273371e0
1 changed files with 4 additions and 7 deletions
|
|
@ -27,13 +27,10 @@ interface AppProps {
|
|||
}
|
||||
|
||||
export function App({ locale }: AppProps) {
|
||||
const { t } = useTranslation(); // 获取 t 函数,以便翻译 "Favorites"
|
||||
|
||||
useEffect(() => {
|
||||
if (locale && i18n.language !== locale) {
|
||||
i18n.changeLanguage(locale);
|
||||
}
|
||||
}, [locale]);
|
||||
if (locale && i18n.language !== locale) {
|
||||
i18n.changeLanguage(locale);
|
||||
}
|
||||
const { t } = useTranslation();
|
||||
|
||||
const categoriesData = useMemo(() => sounds.categories, []);
|
||||
const categories = categoriesData; // 暂时不翻译
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue