Open ARiyou2000 opened 1 month ago
Describe the bug before using useChangeLocale and useCurrentLocale everything is fine. but after using these hooks, I will get the following error:
useChangeLocale
useCurrentLocale
NotFoundError: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
To Reproduce
"use client"; import { createI18nClient } from "next-international/client"; import { supportedLangs } from "@/types/supportedLangs"; export const { useI18n, useScopedI18n, useChangeLocale, useCurrentLocale, I18nProviderClient, } = createI18nClient<Record<supportedLangs, () => Promise<any>>>({ en: () => import("../../dictionaries/en"), fa: () => import("../../dictionaries/fa"), }); const LanguageSelect = (props: SelectProps) => { const currentLocale = useCurrentLocale(); const changeLocal = useChangeLocale(); return ( <div key={"langDiv"}> <Select key={"langSelect"} value={currentLocale} onValueChange={changeLocal} {...props}> <SelectTrigger className="w-[180px]"> <SelectValue placeholder="lang" /> </SelectTrigger> <SelectContent> <SelectItem value="fa">Fa</SelectItem> <SelectItem value="ru">RU</SelectItem> <SelectItem value="en">English</SelectItem> </SelectContent> </Select> </div> ); };
Expected behavior I should get result and not error
Screenshots
About (please complete the following information):
Describe the bug before using
useChangeLocale
anduseCurrentLocale
everything is fine. but after using these hooks, I will get the following error:To Reproduce
Expected behavior I should get result and not error
Screenshots![Screenshot from 2024-05-11 09-44-09](https://github.com/QuiiBz/next-international/assets/35896230/b24198ec-c235-4029-bba3-a3de867b4d5b)
About (please complete the following information):