Skip to content

Commit fb415b3

Browse files
committed
I love frontend
1 parent 401339a commit fb415b3

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/i18next/src/integration.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,13 @@ export function createI18nextIntegration({
179179
return combine(
180180
$t,
181181
variables ? combine(variables) : defaultVariables,
182-
// @ts-expect-error lng is special variable, it should not be passed to t
183-
(t, { lng, ...vars }) => t(key, vars) ?? key
182+
(t, vars) =>
183+
t(
184+
key,
185+
// since i18next@25 t-function mutates variables object,
186+
// so we spread it to avoid mutating original object
187+
{ ...vars }
188+
) ?? key
184189
);
185190
}
186191

0 commit comments

Comments
 (0)