NamespacesConsumer (v9)
Sample usage
import React from 'react';
import { NamespacesConsumer } from 'react-i18next';
function TranslatableView() {
return (
<NamespacesConsumer ns={[
'defaultNamespace',
'anotherNamespace'
]}>
{
(t, { i18n, ready }) => (
<div>
<h1>{t('keyFromDefault')}</h1>
<p>{t('anotherNamespace:key.from.another.namespace', { /* options t options */ })}</p>
</div>
)
}
</NamespacesConsumer>
)
}NamespacesConsumer props
Last updated