fix(i18n): 统一使用 useLazyTranslation 避免翻译 key 闪烁
This commit is contained in:
@@ -4,7 +4,7 @@ import dayjs from '@/utils/dayjs';
|
||||
import CopyButton from '@/components/CopyButton';
|
||||
import type { UnitType } from '@/config/pageTheme';
|
||||
import { DATE_FORMAT, timestampPageStyles } from '@/config/pageTheme';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLazyTranslation } from '@/utils/useLazyTranslation';
|
||||
|
||||
interface ResultViewProps {
|
||||
result: string;
|
||||
@@ -17,7 +17,7 @@ interface ResultViewProps {
|
||||
|
||||
const ResultView = React.memo(
|
||||
({ result, mode, unit, zone, showEmptyPlaceholder = false }: ResultViewProps) => {
|
||||
const { t } = useTranslation(['timestamp']);
|
||||
const { t } = useLazyTranslation('timestamp');
|
||||
|
||||
const extraInfo = useMemo(() => {
|
||||
if (!result) return null;
|
||||
|
||||
Reference in New Issue
Block a user