Overview (v9)
Last updated
Last updated
react-i18next depends on i18next to provide the localization features. So there are two main things flowing through your render tree:
The (short i18n)
The (short t)
Component
Props
Provides
Consumes
i18n, defaultNS
i18n, defaultNs
t, i18n
i18n
t, i18n
i18n
t, i18n
This means your tree will look something like this (assuming you use the options I18nextProvider):
To get the t function (providing the translation functionality) down to your component you have two options:
is a render prop
hoc
is used to translate JSX nodes where just using t is insufficient
Using the hoc
Using the render prop
You have the following options to pass the to the hoc, render prop and Trans component: