Translation (render prop)
What it does
import React from 'react';
import { Translation } from 'react-i18next';
export function MyComponent() {
return (
<Translation>
{
(t, { i18n }) => <p>{t('my translated text')}</p>
}
</Translation>
)
}import React from 'react';
import { Translation } from 'react-i18next';
export function MyComponent() {
return (
<Translation>
{
(t, { i18n }) => <p>{t($ => $['my translated text'])}</p>
}
</Translation>
)
}i18n.changeLanguage('en-US');When to use?
Translation params
Loading namespaces
Overriding the i18next instance
Last updated