undefined 不是一个对象(正在计算'_native.NavigationHelperContext.Provider')

Undefined is not an Object (evaluatig'_native.NavigationHelperContext.Provider')

我试图使用库 @react-navigation/material-top-tabs 创建一个 material 顶部选项卡导航器,但遇到了错误。我确实在文档中完全显示仍然找不到错误 这是我的导航器屏幕的代码。

const tab = createMaterialTopTabNavigator()


export class Home extends Component {


      render() {
        return (
          <NavigationContainer independent={true}>
          <View>
            <Appbar.Header>
            <Appbar.Action icon="home" />
            <Appbar.Content title="Home" />
            </Appbar.Header>
              <tab.Navigator initialRouteName={CurrentLoc} tabBarOptions={{
                activeTintColor: '#04395e',
                swipeEnabled: true
              }}>
                <tab.Screen name="Curent Location" component={CurrentLoc}  options={{
              tabBarLabel: 'Current Location'}}/>
                <tab.Screen name="India" component={IndiaStat}  options={{
              tabBarLabel: 'India'}}/>
              </tab.Navigator>
          </View>
          </NavigationContainer>
        )
      }
    }

export default Home

错误截图: Screenshot

确保您使用的是最新版本的@react-navigation/native

see issue here