I18nextProvider

What it does

The I18nextProvider does take an i18next instance via prop i18n and passes that down using the context API.
1
import { I18nextProvider } from 'react-i18next';
2
import i18n from './i18n';
3
import App from './App';
4
5
<I18nextProvider i18n={i18n}>
6
<App />
7
</I18nextProvider>
Copied!

When to use?

You will only need to use the provider if you need to support multiple i18next instances - eg. if you provide a component library (like this example) or in scenarios for SSR (ServerSideRendering).

I18nextProvider props

name
type (default)
description
i18n
object (undefined)
pass i18next instance the provider will pass it down to translation components by context