Updated packages (Next.js 15.1.0)
Fixed linting
This commit is contained in:
@@ -2,8 +2,6 @@
|
||||
|
||||
import { useCallback, useMemo, useState } from 'react';
|
||||
|
||||
import { useRouter } from 'next/navigation';
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import {
|
||||
@@ -20,7 +18,6 @@ export function LanguageSelector({
|
||||
onChange?: (locale: string) => unknown;
|
||||
}) {
|
||||
const { i18n } = useTranslation();
|
||||
const router = useRouter();
|
||||
const { language: currentLanguage, options } = i18n;
|
||||
|
||||
const locales = (options.supportedLngs as string[]).filter(
|
||||
@@ -46,9 +43,9 @@ export function LanguageSelector({
|
||||
await i18n.changeLanguage(locale);
|
||||
|
||||
// refresh cached translations
|
||||
router.refresh();
|
||||
window.location.reload();
|
||||
},
|
||||
[i18n, router, onChange],
|
||||
[i18n, onChange],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user