gpt4 book ai didi

react-native - 如何删除覆盖导航 5.x 警告

转载 作者:行者123 更新时间:2023-12-03 23:08:53 27 4
gpt4 key购买 nike

我正在使用 react native Expo 开发移动应用程序。我使用了 React Navigation 版本 5.x 并收到以下警告:

web 编译时带有警告。

D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'DrawerActionType' is not exported from './DrawerRouter'.

D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'DrawerNavigationState' is not exported from './DrawerRouter'.

D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'DrawerRouterOptions' is not exported from './DrawerRouter'.

D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'StackActionType' is not exported from './StackRouter'.

D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'StackNavigationState' is not exported from './StackRouter'.

D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'StackRouterOptions' is not exported from './StackRouter'.

D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'TabActionType' is not exported from './TabRouter'.

D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'TabNavigationState' is not exported from './TabRouter'.

D:/_expo/navi/node_modules/@react-navigation/routers/lib/module/index.js Attempted import error: 'TabRouterOptions' is not exported from './TabRouter'.



请指导。

最佳答案

删除未从文件中导出的导入。

从我看到的 StackRouter、TabRouter 和 DrawerRouter 遵循相同的模式,并且没有导出具有结尾的导入:ActionType、RouterOptions 和 NavigationState。

我不知道世博会是否会因为 SDK 或我不知道的原因而将这些导入留待以后使用,我在此处进行了更改,并且我的项目在没有这些黄框的情况下继续正常运行。

node_modules/@react-navigation/routers/lib/module/index.js 之前:

import * as CommonActions from './CommonActions';
export { CommonActions };
export { default as BaseRouter } from './BaseRouter';
export { default as StackRouter, StackActions, StackActionType, StackRouterOptions, StackNavigationState } from './StackRouter';
export { default as TabRouter, TabActions, TabActionType, TabRouterOptions, TabNavigationState } from './TabRouter';
export { default as DrawerRouter, DrawerActions, DrawerActionType, DrawerRouterOptions, DrawerNavigationState } from './DrawerRouter';
export * from './types';
//# sourceMappingURL=index.js.map

node_modules/@react-navigation/routers/lib/module/index.js 之后:
import * as CommonActions from './CommonActions';
export { CommonActions };
export { default as BaseRouter } from './BaseRouter';
export { default as StackRouter, StackActions } from './StackRouter';
export { default as TabRouter, TabActions } from './TabRouter';
export { default as DrawerRouter, DrawerActions } from './DrawerRouter';
export * from './types';
//# sourceMappingURL=index.js.map

关于react-native - 如何删除覆盖导航 5.x 警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60212460/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com