Skip to content

Commit 3bf5c85

Browse files
committed
use use-sync-external-store shim for useSyncExternalStore
1 parent e505cb0 commit 3bf5c85

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

package-lock.json

Lines changed: 18 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
},
6666
"dependencies": {
6767
"@babel/runtime": "^7.27.6",
68-
"html-parse-stringify": "^3.0.1"
68+
"html-parse-stringify": "^3.0.1",
69+
"use-sync-external-store": "1.6.0"
6970
},
7071
"peerDependencies": {
7172
"i18next": ">= 25.4.1",

src/useTranslation.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
1-
import {
2-
useContext,
3-
useCallback,
4-
useMemo,
5-
useEffect,
6-
useSyncExternalStore,
7-
useRef,
8-
useState,
9-
} from 'react';
1+
import { useContext, useCallback, useMemo, useEffect, useRef, useState } from 'react';
2+
// eslint-disable-next-line import/no-extraneous-dependencies
3+
import { useSyncExternalStore } from 'use-sync-external-store/shim';
104
import { getI18n, getDefaults, ReportNamespaces, I18nContext } from './context.js';
115
import {
126
warnOnce,

0 commit comments

Comments
 (0)