Skip to content

Commit

Permalink
fix because of new i18next mts export
Browse files Browse the repository at this point in the history
  • Loading branch information
adrai committed Nov 12, 2023
1 parent fc60f78 commit eafe8d1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/createClient/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import {
InternalConfig,
CreateClientReturn,
InitPromise,
I18n,
} from '../types'

export default (config: InternalConfig): CreateClientReturn => {
if (config.ns === undefined) config.ns = []
const instance = i18n.createInstance(config)
const instance = i18n.createInstance(config) as I18n
let initPromise: InitPromise

if (!instance.isInitialized) {
Expand Down
4 changes: 2 additions & 2 deletions src/createClient/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ export default (config: InternalConfig): CreateClientReturn => {
if (config.ns === undefined) config.ns = []
let instance: I18n
if (!globalInstance) {
globalInstance = i18n.createInstance(config)
globalInstance = i18n.createInstance(config) as I18n
instance = globalInstance
} else {
instance = globalInstance.cloneInstance({
...config,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
initImmediate: false,
})
}) as I18n
}
let initPromise: InitPromise

Expand Down

0 comments on commit eafe8d1

Please sign in to comment.