我有contentComponent:DrawerContainer
在DrawerContainer中,我现在有一个按钮,我想每次用户关闭抽屉时都检查文本
通过使用以下代码,我可以获取DrawerClose,但我不知道如何将其传递给contentComponent:DrawerContainer
const defaultGetStateForAction = DrawerStack.router.getStateForAction;
DrawerStack.router.getStateForAction = (action, state) => {
//use 'DrawerOpen' to capture drawer open event
if (state && action.type === 'Navigation/NAVIGATE' && action.routeName === 'DrawerClose') {
console.log('DrawerClose')
}
return defaultGetStateForAction(action, state);
};