MCPcopy Index your code
hub / github.com/react-navigation/react-navigation / MyNavScreen

Function MyNavScreen

example/src/SimpleDrawer.tsx:25–123  ·  view source on GitHub ↗
({
  navigation,
  banner,
}: {
  navigation: NavigationDrawerProp<NavigationRoute, Params>;
  banner: string;
})

Source from the content-addressed store, hash-verified

23type Params = { drawerLockMode: 'unlocked' | 'locked-open' | 'locked-closed' };
24
25const MyNavScreen = ({
26 navigation,
27 banner,
28}: {
29 navigation: NavigationDrawerProp<NavigationRoute, Params>;
30 banner: string;
31}) => {
32 let theme = useTheme();
33
34 return (
35 <ScrollView>
36 <SafeAreaView forceInset={{ top: 'always' }}>
37 <View
38 style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}
39 >
40 <SampleText>{banner}</SampleText>
41 </View>
42 <Themed.TextInput
43 style={{
44 flex: 1,
45 height: 35,
46 marginHorizontal: 10,
47 marginVertical: 10,
48 borderWidth: StyleSheet.hairlineWidth,
49 borderColor: ThemeColors[theme].bodyBorder,
50 textAlign: 'center',
51 }}
52 placeholder="Focus this TextInput then drag the drawer!"
53 />
54 <Button onPress={() => navigation.openDrawer()} title="Open drawer" />
55 <Button
56 onPress={() => navigation.toggleDrawer()}
57 title="Toggle drawer"
58 />
59 <Button
60 onPress={() => {
61 navigation.openDrawer();
62 navigation.closeDrawer();
63 }}
64 title="Open and immediately close"
65 />
66 <Button
67 onPress={() => {
68 navigation.closeDrawer();
69 navigation.openDrawer();
70 }}
71 title="Close and immediately open"
72 />
73 <Button
74 onPress={() => {
75 navigation.openDrawer();
76 setTimeout(() => {
77 navigation.closeDrawer();
78 }, 150);
79 }}
80 title="Open then close drawer shortly after"
81 />
82 <Button

Callers

nothing calls this directly

Calls 3

navigateMethod · 0.80
getParamMethod · 0.80
useThemeFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…