refine
refine copied to clipboard
[BUG] Inconsistent `getLocale` return type (`string | undefined`)
Why does getLocale have return type () => string | undefined in useTranslation if getLocale has type () => string in i18nProvider?
https://github.com/refinedev/refine/blob/39dff272c20c04efaa91d1bf35b08e078465db72/packages/core/src/hooks/i18n/useGetLocale.ts#L5
https://github.com/refinedev/refine/blob/39dff272c20c04efaa91d1bf35b08e078465db72/packages/core/src/contexts/i18n/types.ts#L12
It's annoying having to say const locale = getLocale() || "en" or const locale = getLocale()! when we already know the return type will be string.