-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Description
Why does getLocale
have return type () => string | undefined
in useTranslation
if getLocale
has type () => string
in i18nProvider
?
export type UseGetLocaleType = () => () => string | undefined; |
type GetLocaleFunction = () => string; |
It's annoying having to say const locale = getLocale() || "en"
or const locale = getLocale()!
when we already know the return type will be string
.
Metadata
Metadata
Assignees
Labels
No labels