Skip to content

Fix: _EnableSelector type (for compatibility, enableSelector does not exist in TypeOptions) - #1858

Merged
adrai merged 1 commit into
i18next:masterfrom
nemuvski:fix-enableselector-type
Aug 21, 2025
Merged

adrai merged 1 commit into
i18next:masterfrom
nemuvski:fix-enableselector-type

Conversation

@nemuvski

@nemuvski nemuvski commented Aug 21, 2025 •

Copy link
Copy Markdown
Contributor

Hello,

I have updated to v15.7.0, but I encountered a case where type inference with useTranslation() does not work correctly.

In my project, I am using i18next v25.3.x.
(I am aware that updating to v25.4 would resolve the issue.)

Since enableSelector is not defined in TypeOptions, type inference is failing.

ss-inferred-any

Looking at the peerDependencies, I noticed that "i18next": ">= 23.2.3" is specified.
Considering compatibility, I thought it would be appropriate to handle cases where enableSelector is not present in TypeOptions, so I made this PR.

Thank you for your consideration.

Checklist

  • only relevant code is changed (make a diff before you submit the PR)
  • run tests npm run test
  • tests are included
  • commit message and code follows the Developer's Certification of Origin

@adrai

adrai commented Aug 21, 2025

Copy link
Copy Markdown
Member

@ahrjarrett ok for you?

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 95.864%. remained the same
when pulling 73a7260 on nemuvski:fix-enableselector-type
into 1d7ad47 on i18next:master.

@ahrjarrett

Copy link
Copy Markdown
Member

Ah, good catch. @adrai yep, makes sense to me

@adrai
adrai merged commit 641f6e5 into i18next:master Aug 21, 2025
9 checks passed
@adrai

adrai commented Aug 21, 2025

Copy link
Copy Markdown
Member

Thank you...
included in v15.7.1

@nemuvski
nemuvski deleted the fix-enableselector-type branch August 21, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants