0

我遇到了这种棘手的情况,我需要“在我的 Next _app 文件中导出 2 个默认值(使用打字稿)。

我开始为 Redux 导出它,我在我的应用程序中使用它

export default wrapper.withRedux(MyApp);

但是现在我需要使用 next-i18next 翻译我的应用程序,我在其中导入 appWithTranslation 并且还需要将其导出

import { appWithTranslation } from 'next-i18next';
export default appWithTranslation(MyApp);

是否有可能以某种方式有 2 个导出默认值?

4

1 回答 1

0

这是不可能的,但您可以选择wrapper.withRedux(appWithTranslation(MyAppp))appWithTranslation(wrapper.withRedux(MyApp))(不确定您需要哪个顺序),因此您将获得一个默认导出 - 使用 redux 和翻译。

于 2021-03-13T12:22:03.123 回答