Как обнаружить DrawerClose в contentComponent - PullRequest
0 голосов
/ 11 октября 2018

У меня есть 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);
};
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...