-
-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
Hey WebDevSimplified,
I was implementing your stuff on my project and faced this issue.
TS2344: Type
NormalizedTranslationAtKey<TranslationAtKeyWithParams<LanguageMessages, S>>[0]
does not satisfy the constraint string
Type
NormalizedTranslationAtKey<S extends string | number ? LanguageMessages | I18nMessage : never>[0]
is not assignable to type string
Type string | LanguageMessages is not assignable to type string
Type LanguageMessages is not assignable to type strin
luckily, I solved it with adding extra code at end ofNormalizedTranslationAtKeyWithParams enforcing to accept possible types but hopefully is has a better solution.
type NormalizedTranslationAtKeyWithParams<Key extends string> = NormalizedTranslationAtKey<
TranslationAtKeyWithParams<RegisteredTranslations, Key> &
(string | ReturnType<typeof defineTranslation>)
>Thanks for you great solution,
br,
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels