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

Function MyScreen

example/src/navigation-examples/nested-stack-tabs.tsx:64–99  ·  view source on GitHub ↗
({
  title,
  showPopButton = false,
  bg,
}: {
  title: string;
  showPopButton?: boolean;
  bg?: string;
})

Source from the content-addressed store, hash-verified

62}
63
64function MyScreen({
65 title,
66 showPopButton = false,
67 bg,
68}: {
69 title: string;
70 showPopButton?: boolean;
71 bg?: string;
72}) {
73 function push() {
74 navigation.stack.push(
75 <Stack.Screen>
76 <MyScreen title="Pushed screen" showPopButton />
77 </Stack.Screen>
78 );
79 }
80
81 function pop() {
82 navigation.stack.pop();
83 }
84
85 return (
86 <View
87 style={{
88 flex: 1,
89 justifyContent: "center",
90 alignItems: "center",
91 backgroundColor: bg || "white",
92 }}
93 >
94 <Text>{title}</Text>
95 <Button title="Push screen" onPress={push} />
96 {showPopButton && <Button title="Pop screen" onPress={pop} />}
97 </View>
98 );
99}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected