Title rewritten as: Unable to update `DrawerNavigator` component while rendering `Main2` component
P粉131455722
P粉131455722 2023-09-12 23:32:39
0
1
542

When I go from one page to another, this error pops up, although the conversion is successful, I want to get rid of this error, here is my code sample, please tell me how to fix this error?

function Root() {

  return (
    <Drawer.Navigator initialRouteName="Home"
    
    //drawerContentOptions={{}}
    //drawerContent={<Text></Text>}
    screenOptions={{
      drawerActiveTintColor: '#0069B3',
      itemStyle: { marginVertical: 5 },
    }}
    drawerContent={(props) => <LeftMenu {...props} />}>
      <Drawer.Screen name="New" component={New}  options={{ drawerLabel: '1',title: "1", headerStyle:{backgroundColor: '#0069B3', height: 75}, headerTintColor: '#fff', headerTitleStyle:{fontSize: 22, fontWeight: '600'}, headerTitleAlign: 'left'}}/>
      <Drawer.Screen name="Home" component={Main}  options={{ drawerLabel: '2',title: "2", headerStyle:{backgroundColor: '#0069B3', height: 75}, headerTintColor: '#fff', headerTitleStyle:{fontSize: 22, fontWeight: '600'}, headerTitleAlign: 'left'}}/>
    </Drawer.Navigator>  

);
}
export const Navigator =() =>{
    const Stack = createStackNavigator();
    return(
      
    <Stack.Navigator  screenOptions={{}} initialRouteName="Authorization">
    <Stack.Screen name="Root" component={Root}options={{ headerShown: false }}/> 
    <Stack.Screen name="Root2" component={Root2}options={{ headerShown: false }}/> 
    <Stack.Screen name="Authorization" component={Authorization} options={{ headerShown: false }}/>

  </Stack.Navigator>
    )
}

P粉131455722
P粉131455722

reply all(1)
P粉571233520

There is a navigation.setOptions parameter on my page, I put it in useEffect

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!