mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-01-12 22:51:18 +08:00
feat: add helper and hook for container ref
This commit is contained in:
@@ -28,7 +28,7 @@ import {
|
||||
DefaultTheme,
|
||||
DarkTheme,
|
||||
PathConfigMap,
|
||||
NavigationContainerRef,
|
||||
useNavigationContainerRef,
|
||||
} from '@react-navigation/native';
|
||||
import { createDrawerNavigator } from '@react-navigation/drawer';
|
||||
import {
|
||||
@@ -193,7 +193,7 @@ export default function App() {
|
||||
return () => Dimensions.removeEventListener('change', onDimensionsChange);
|
||||
}, []);
|
||||
|
||||
const navigationRef = React.useRef<NavigationContainerRef>(null);
|
||||
const navigationRef = useNavigationContainerRef<RootStackParamList>();
|
||||
|
||||
useReduxDevToolsExtension(navigationRef);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user