You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unsure if this is related to this module but I was expecting that defining a fallbackLocale would always return a string. I am trying to do this:
import{getUserLocale}from"get-user-locale"constlocale=getUserLocale({fallbackLocale: "en",useFallbackLocale: true})if(["in","hi-IN"].includes(locale){// do something}
However, include complains with below type error about possible null so I am guessing it is not detected:
Argument of type 'string | null' is not assignable to parameter of type 'string'.
Type 'null' is not assignable to type 'string'.
Any pointers on how to solve this, if possible at all?
The text was updated successfully, but these errors were encountered:
Unless useFallbackLocale was specifically set to false, indeed there's no possibility of getting null back. I fixed that by adding function overloads :)
Unsure if this is related to this module but I was expecting that defining a
fallbackLocale
would always return a string. I am trying to do this:However,
include
complains with below type error about possiblenull
so I am guessing it is not detected:Any pointers on how to solve this, if possible at all?
The text was updated successfully, but these errors were encountered: