我想在抽屉打开和抽屉关闭事件上调用类函数,因为我是React Native的新手,有人可以帮助我吗?
const defaultGetStateForAction =Drawer.router.getStateForAction;
Drawer.router.getStateForAction = (action, state) => {
if(state && action.type === 'Navigation/OPEN_DRAWER' ) {
Alert.alert("drawerOpen")
//here call a class function with true value
}
if(state && action.type === 'Navigation/DRAWER_CLOSED') {
Alert.alert("drawerClose")
//here call a class function with false value
}