如何修复 React Native 中的 "Cannot read property 'router' of undefined" 错误

How do I fix "Cannot read property 'router' of undefined" error in React Native

The image of the code

这一切都在 React Native 中

在代码中将以下行放在 App.js

AppContainer = createAppContainer(AppNavigator);

而不是

const AppContainer = createAppContainer();