React native React本机应用程序-React navigation v5 can';不要在blur上卸载
我需要在屏幕失去焦点时卸载它。我正在使用一个自定义抽屉,并使用props unmontonblur={true}和options={{unmontonblur:true}但它不起作用。我做错了什么,或者是否有其他方法来实现这一点?我感谢您的帮助。以下是相关代码:React native React本机应用程序-React navigation v5 can';不要在blur上卸载,react-native,react-navigation-v5,React Native,React Navigation V5,我需要在屏幕失去焦点时卸载它。我正在使用一个自定义抽屉,并使用props unmontonblur={true}和options={{unmontonblur:true}但它不起作用。我做错了什么,或者是否有其他方法来实现这一点?我感谢您的帮助。以下是相关代码: <Drawer.Navigator drawerContent={(props) => <CustomDrawer {...props} />}> <Drawer.Screen
<Drawer.Navigator drawerContent={(props) => <CustomDrawer {...props} />}>
<Drawer.Screen
name='Client Profile'
component={ProfileStackNavigator}
unmountOnBlur={true}
options={{unmountOnBlur: true}}
/>
</Drawer.Navigator>
}>
下面是CustomDrawer.js上的代码:
<DrawerContentScrollView {...props} >
<DrawerItem
label='Profile'
onPress={() => props.navigation.navigate('Client Profile')}
unmountOnBlur={true}
options={{unmountOnBlur: true}}
/>
</DrawerContentScrollView>
props.navigation.navigate('Client Profile')}
unmontonblur={true}
选项={{unmontonblur:true}}
/>
不在自定义抽屉内使用DrawerItemList的任何原因?是,当我在抽屉之间呈现一些UI时,MSDrawerItem更像是一个列表,而不是实际的导航,这样prop就不会通过任何其他方式来实现这一点?我在官方文档中找不到一种方法,可能是迭代抽屉列表。我没有尝试过,因为有任何理由不在自定义抽屉中使用抽屉列表吗?是的,由于我在DroperItemsDrawerItem之间呈现一些UI,因此DrawerItem更像是一个列表,而不是实际的导航,因此无法通过任何其他方式实现这一点?我在官方文档中看不到任何方法,可能是迭代DroperItemList,但我还没有尝试过