如何删除到达导航5.x警告

问题描述 投票:0回答:1

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

web编译有警告。D:/ _ expo/navi/node_modules/@react-navigation/routers/lib/module/index.js尝试导入错误:未从“ ./DrawerRouter”导出“ DrawerActionType”。

D:/ _ expo/navi/node_modules/@react-navigation/routers/lib/module/index.js尝试导入错误:未从“ ./DrawerRouter”导出“ DrawerNavigationState”。

D:/ _ expo/navi/node_modules/@react-navigation/routers/lib/module/index.js尝试导入错误:未从“ ./DrawerRouter”导出“ DrawerRouterOptions”。

D:/ _ expo/navi/node_modules/@react-navigation/routers/lib/module/index.js尝试导入错误:未从“ ./StackRouter”导出“ StackActionType”。

D:/ _ expo/navi/node_modules/@react-navigation/routers/lib/module/index.js尝试导入错误:“ ./ StackRouter”未导出“ StackNavigationState”。

D:/ _ expo/navi/node_modules/@react-navigation/routers/lib/module/index.js尝试导入错误:“ ./ StackRouter”未导出“ StackRouterOptions”。

D:/ _ expo/navi/node_modules/@react-navigation/routers/lib/module/index.js尝试导入错误:“ ./ TabRouter”未导出“ TabActionType”。

D:/ _ expo/navi/node_modules/@react-navigation/routers/lib/module/index.js尝试导入错误:“ ./ TabRouter”未导出“ TabNavigationState”。

D:/ _ expo/navi/node_modules/@react-navigation/routers/lib/module/index.js尝试导入错误:未从“ ./TabRouter”导出“ TabRouterOptions”。

请指导。

react-native react-navigation react-navigation-drawer
1个回答
0
投票

是的,您可以通过注释位于node_modules(@react-navigation\routers\libs\modules\index.js)中的index.js文件的以下几行来轻松禁用它:

//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';
© www.soinside.com 2019 - 2024. All rights reserved.