Skip to content

Upgrade to v22.0.5 causes type errors because of t returning null #1866

Answered by pedrodurek
medihack asked this question in Q&A
Discussion options

You must be logged in to vote

t function can return null, this behaviour is set by default, if you want to change it, set returnNull type to false.

// i18next.d.ts
import 'i18next';

declare module 'i18next' {
  interface CustomTypeOptions {
    returnNull: false;
    ...
  }
}

I also recommend updating your i18next configuration to behave accordantly. https://www.i18next.com/overview/configuration-options#translation-defaults

i18next.init({
  returnNull: false,
   ...
});

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@medihack
Comment options

@pedrodurek
Comment options

@medihack
Comment options

Answer selected by medihack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants