React native TypeError:TypeError:undefined不是对象(正在计算';props.navigationState.index';)

React native TypeError:TypeError:undefined不是对象(正在计算';props.navigationState.index';),react-native,React Native,我显示了此错误,但不知道原因: [15:52:26]TypeError:TypeError:undefined不是对象 (评估“props.navigationState.index”) 此错误位于: 在tabBarComponent中(位于createBottomTabNavigator.js:72) 在RCTView中(在View.js:45) 在视图中(位于createBottomTabNavigator.js:102) 在TabNavigationView中(位于createTabNav

我显示了此错误,但不知道原因:

[15:52:26]TypeError:TypeError:undefined不是对象 (评估“props.navigationState.index”)

此错误位于: 在tabBarComponent中(位于createBottomTabNavigator.js:72) 在RCTView中(在View.js:45) 在视图中(位于createBottomTabNavigator.js:102) 在TabNavigationView中(位于createTabNavigator.js:197) 在NavigationView中(由Navigator创建) 导航器中(由SceneView创建) 在SceneView中(在DroperView.js:149) 在RCTView中(在View.js:45) 在视图中(位于ResourceSavingScene.js:20) 在RCTView中(在View.js:45) 在视图中(位于ResourceSavingScene.js:16) 在ResourceSavingScene中(位于DroperView.js:148) 在RCTView中(在View.js:45) 在视图中(位于screens.native.js:83) 在ScreenContainer中(在DrawerView.js:138处) 在RCTView中(在View.js:45) 在视图中(位于createAnimatedComponent.js:153) 在AnimatedComponent中(位于DrawerLayout.js:323) 在RCTView中(在View.js:45) 在视图中(位于createAnimatedComponent.js:153) 在AnimatedComponent中(位于DrawerLayout.js:322) in处理程序(位于DrawerLayout.js:358) 抽屉内布局(位于抽屉视图js:161) 抽屉视图中(由导航器创建) 在导航器中(位于createAppContainer.js:388) 在NavigationContainer中(位于routes.js:42) 课堂内(见App.js:53) 供应商内部(位于App.js:52) 应用程序内(位于registerRotComponent.js:17) 在RootErrorBoundary中(在registerRotComponent.js:16处) 在ExprootComponent中(位于renderApplication.js:34) 在RCTView中(在View.js:45) 在视图中(位于AppContainer.js:98) 在RCTView中(在View.js:45) 在视图中(位于AppContainer.js:115) 在AppContainer中(位于renderApplication.js:33)

此错误位于: 在NavigationContainer中(位于routes.js:42) 课堂内(见App.js:53) 供应商内部(位于App.js:52) 应用程序内(位于registerRotComponent.js:17) 在RootErrorBoundary中(在registerRotComponent.js:16处) 在ExprootComponent中(位于renderApplication.js:34) 在RCTView中(在View.js:45) 在视图中(位于AppContainer.js:98) 在RCTView中(在View.js:45) 在视图中(位于AppContainer.js:115) 在AppContainer中(位于renderApplication.js:33) *tabbar组件中的src/modules/BoardScreen/index.js:21:58 -node_modules/react native/Libraries/Renderer/oss/reactiverenderer-dev.js:12020:22 在MountUndeterminateComponent中 -node_modules/react native/Libraries/Renderer/oss/reactiverenderer-dev.js:16075:21 工作中 - ... 框架内构件的14个堆叠框架

在以下代码行中:

                            active={props.navigationState.index === 0}
我的index.js如下所示:

export default (MainScreenNavigator = createBottomTabNavigator(
    {
        Tasks: { screen: Tasks },
        Members: { screen: Members },
        Chat: { screen: Chat }
    },
    {
        tabBarPosition: "bottom",
        tabBarComponent: props => {
            return (
                <Footer>
                    <FooterTab>
                        <Button
                            vertical
                            active={props.navigationState.index === 0}
                            onPress={() => props.navigation.navigate("Tasks")}>
                            <Icon name="bookmarks" />
                            <Text>Tasks</Text>
                        </Button>
                        <Button
                            vertical
                            active={props.navigationState.index === 1}
                            onPress={() => props.navigation.navigate("Members")}>
                            <Icon name="people" />
                            <Text>Members</Text>
                        </Button>
                        <Button
                            vertical
                            active={props.navigationState.index === 2}
                            onPress={() => props.navigation.navigate("Chat")}>
                            <Icon name="git-branch" />
                            <Text>Chat</Text>
                        </Button>
                    </FooterTab>
                </Footer>
            );
        }
    }
));
导出默认值(MainScreenNavigator=CreateBoottomTabNavigator(
{
任务:{屏幕:任务},
成员:{screen:Members},
聊天:{屏幕:聊天}
},
{
tabbar位置:“底部”,
tabBarComponent:props=>{
返回(
props.navigation.navigate(“任务”)}>
任务
props.navigation.navigate(“成员”)}>
成员
props.navigation.navigate(“聊天”)}>
聊天
);
}
}
));
有人能帮我吗。

根据它应该是
props.navigation.state.index