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

Function MyScreen

example/src/navigation-examples/basic-stack.tsx:9–37  ·  view source on GitHub ↗
({
  title,
  children,
}: {
  title: string;
  children?: React.ReactNode;
})

Source from the content-addressed store, hash-verified

7}
8
9function MyScreen({
10 title,
11 children,
12}: {
13 title: string;
14 children?: React.ReactNode;
15}) {
16 function push() {
17 navigation.stack.push(
18 <Stack.Screen>
19 <MyScreen title="Pushed screen">
20 <Button title="Pop screen" onPress={pop} />
21 </MyScreen>
22 </Stack.Screen>
23 );
24 }
25
26 function pop() {
27 navigation.stack.pop();
28 }
29
30 return (
31 <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }}>
32 <Text>{title}</Text>
33 <Button title="Push screen" onPress={push} />
34 {children}
35 </View>
36 );
37}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected