You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
355 B
20 lines
355 B
3 years ago
|
import { createElement, useMemo } from 'react';
|
||
|
import { I18nContext } from './context';
|
||
|
|
||
|
export function I18nextProvider({ i18n, defaultNS, children }) {
|
||
|
const value = useMemo(
|
||
|
() => ({
|
||
|
i18n,
|
||
|
defaultNS,
|
||
|
}),
|
||
|
[i18n, defaultNS],
|
||
|
);
|
||
|
return createElement(
|
||
|
I18nContext.Provider,
|
||
|
{
|
||
|
value,
|
||
|
},
|
||
|
children,
|
||
|
);
|
||
|
}
|