Closed lypeng29 closed 5 years ago
运行示例文件报错:“In react-navigation 3 you must set up your app container directly. More info:https://reactnavigation.org/docs/en/app-containers.html”
解决: 文件头部导入: import { createStackNavigator, createAppContainer } from 'react-navigation'; 修改文件末尾: const AppContainer = createAppContainer(navigator); AppRegistry.registerComponent('test', () => AppContainer);
@lypeng29 你说的是example工程么?我看了下,里面的package.json的依赖是react-navigation v2的~
哦哦,那你关闭吧,我采用默认装的是v3~
运行示例文件报错:“In react-navigation 3 you must set up your app container directly. More info:https://reactnavigation.org/docs/en/app-containers.html”
解决: 文件头部导入: import { createStackNavigator, createAppContainer } from 'react-navigation'; 修改文件末尾: const AppContainer = createAppContainer(navigator); AppRegistry.registerComponent('test', () => AppContainer);