0

code

function TopTabs() {
    return (
        <TopTab.Navigator>
            <TopTab.Screen name="Item" component={Item} />
            <TopTab.Screen name="Notes" component={Notes} />
        </TopTab.Navigator>
    );
}

export default function App() {
    return (
        <SafeAreaView style={styles.container}>
            <StatusBar style="auto" />
            <NavigationContainer >
                <Stack.Navigator>
                    <Stack.Screen name="Main Screen" component={MainScreen} options={{
                        headerShown: false
                    }} />
                    <Stack.Screen name="TopTabs" component={TopTabs} />
                </Stack.Navigator>
            </NavigationContainer>
        </SafeAreaView>
    );
}

========================================================================================================

when navigating to TopTabs item then clicking the notes tab, the params in notes screen is undefiend. how can i pass the params also to the Notes screen after clicking the notes tab?

navigation.navigate('TopTabs', {
    screen: 'Item',
    params: { id }
});

0 Answers0