Skip to content

Commit fd37772

Browse files
committed
Less changes
1 parent fb415b3 commit fd37772

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/i18next/src/integration.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ type I18nextIntegration = {
3939

4040
const identity = ((key: string) => key) as TFunction;
4141

42-
const defaultVariables = createStore({}, { serialize: 'ignore' });
43-
4442
export function createI18nextIntegration({
4543
instance,
4644
setup,
@@ -177,14 +175,14 @@ export function createI18nextIntegration({
177175
variables?: Record<string, Store<string>>
178176
): Store<string> {
179177
return combine(
180-
$t,
181-
variables ? combine(variables) : defaultVariables,
182-
(t, vars) =>
178+
{ t: $t, variables: combine(variables ?? {}) },
179+
({ t, variables }) =>
183180
t(
181+
key,
184182
key,
185183
// since i18next@25 t-function mutates variables object,
186184
// so we spread it to avoid mutating original object
187-
{ ...vars }
185+
{ ...variables }
188186
) ?? key
189187
);
190188
}

0 commit comments

Comments
 (0)