From dfaf0279d46ade118190e112c4a23d8fe727be6c Mon Sep 17 00:00:00 2001 From: Patrick Metzdorf Date: Wed, 25 Aug 2021 00:36:37 +0100 Subject: [PATCH] update drawer actions on useNavigation hook --- screens/HomeScreen.js | 10 +++++----- screens/VideosScreen.js | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/screens/HomeScreen.js b/screens/HomeScreen.js index 928bd96..4127cfb 100644 --- a/screens/HomeScreen.js +++ b/screens/HomeScreen.js @@ -3,7 +3,7 @@ import { Button, Divider, Layout, TopNavigation, TopNavigationAction } from '@ui import { MenuIcon } from "../assets/icons"; import React from 'react'; import { SafeAreaView } from 'react-native-safe-area-context'; -import { useNavigation } from "@react-navigation/native"; +import { useNavigation, DrawerActions } from "@react-navigation/native"; export const HomeScreen = () => { const navigation = useNavigation(); @@ -13,21 +13,21 @@ export const HomeScreen = () => { const renderDrawerAction = () => ( navigation.openDrawer()} + onPress={() => navigation.dispatch(DrawerActions.openDrawer())} /> ); return ( - + + /> ); -}; \ No newline at end of file +}; diff --git a/screens/VideosScreen.js b/screens/VideosScreen.js index a66a212..7748b05 100644 --- a/screens/VideosScreen.js +++ b/screens/VideosScreen.js @@ -3,29 +3,29 @@ import { Divider, Layout, Text, TopNavigation, TopNavigationAction } from '@ui-k import React from 'react'; import { SafeAreaView } from 'react-native-safe-area-context'; -import { useNavigation } from "@react-navigation/native"; +import { useNavigation, DrawerActions } from "@react-navigation/native"; export const VideosScreen = () => { const navigation = useNavigation(); - + const renderDrawerAction = () => ( navigation.openDrawer()} + onPress={() => navigation.dispatch(DrawerActions.openDrawer())} /> ); return ( - + + /> Videos ); -}; \ No newline at end of file +};