MCPcopy Create free account
hub / github.com/ajsmth/rn-tools / MyScreen

Function MyScreen

example/src/navigation-examples/multi-nested-examples.tsx:54–130  ·  view source on GitHub ↗
({
  colorClassName = "bg-white",
  children,
}: {
  colorClassName?: string;
  children?: React.ReactNode;
})

Source from the content-addressed store, hash-verified

52}
53
54function MyScreen({
55 colorClassName = "bg-white",
56 children,
57}: {
58 colorClassName?: string;
59 children?: React.ReactNode;
60}) {
61 return (
62 <View className={"flex-1" + " " + colorClassName}>
63 {children || (
64 <View className="flex-1 gap-4">
65 <TouchableOpacity
66 onPress={() =>
67 navigation.stack.push(
68 <Stack.Screen>
69 <MyScreen />
70 </Stack.Screen>
71 )
72 }
73 >
74 <Text className="font-medium text-lg">Push Screen</Text>
75 </TouchableOpacity>
76
77 <TouchableOpacity
78 onPress={() =>
79 navigation.stack.push(
80 <Stack.Screen
81 stackPresentation="modal"
82 stackAnimation="slide_from_bottom"
83 gestureEnabled={true}
84 >
85 <Stack.Navigator rootScreen={<MyScreen />} />
86 </Stack.Screen>
87 )
88 }
89 >
90 <Text className="font-medium text-lg">Push Modal</Text>
91 </TouchableOpacity>
92
93 <TouchableOpacity
94 onPress={() =>
95 navigation.stack.push(
96 <Stack.Screen>
97 <MyTabs />
98 </Stack.Screen>
99 )
100 }
101 >
102 <Text className="font-medium text-lg">Push Tabs</Text>
103 </TouchableOpacity>
104
105 <TouchableOpacity
106 onPress={() => {
107 navigation.stack.pop();
108 }}
109 >
110 <Text className="font-medium text-lg">Pop</Text>
111 </TouchableOpacity>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected