i18next/react-i18next

View on GitHub
src/I18nextProvider.js

Summary

Maintainability
A
0 mins
Test Coverage
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,
  );
}