我在我的应用程序中使用 react-i18nextI18nextProvider和withNamespaces.
export const App = () => (
<I18nextProvider i18n={i18n}>
<App />
</I18nextProvider>
);
export default withNamespaces()(ChildComponentOfApp);
但我不明白I18nextProviderand的关系withNamespaces。他们不传递道具之类的t功能
提供者负责使用 react context api 将 props 传入的 i18next 实例向下传递给所有 withNamespaces hocs 或 NamespacesConsumer 渲染 prop。
是为什么工作?这是渲染道具withNamespaces吗?
我知道那是 HOC,但在阅读 react-i18next 源代码之后甚至混淆withNamespaces了这种关系。I18nextProviderwithNamespaces
有人可以解释一下吗?