Skip to content

Commit 641f6e5

Browse files
authored
fix: _EnableSelector type (For compatibility, enableSelector does not exist in TypeOptions) (#1858)
1 parent 1d7ad47 commit 641f6e5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ type _DefaultNamespace = TypeOptions['defaultNS'];
6767

6868
export function useSSR(initialI18nStore: Resource, initialLanguage: string): void;
6969

70-
type _EnableSelector = TypeOptions['enableSelector'];
70+
// If the version is earlier than i18next v25.4.0, enableSelector does not exist in TypeOptions, so a conditional type is used to maintain type compatibility.
71+
type _EnableSelector = TypeOptions extends { enableSelector: infer U } ? U : false;
7172

7273
export type UseTranslationOptions<KPrefix> = {
7374
i18n?: i18n;

0 commit comments

Comments
 (0)