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

Function MyScreen

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

Source from the content-addressed store, hash-verified

51}
52
53function MyScreen({
54 title,
55 children,
56 bg,
57}: {
58 title: string;
59 children?: React.ReactNode;
60 bg?: string;
61}) {
62 function push() {
63 navigation.stack.push(
64 <Stack.Screen>
65 <MyScreen title="Pushed screen" bg={bg}>
66 <Button title="Pop screen" onPress={pop} />
67 </MyScreen>
68 </Stack.Screen>,
69 );
70 }
71
72 function pop() {
73 navigation.stack.pop();
74 }
75
76 return (
77 <View
78 style={{
79 flex: 1,
80 justifyContent: "center",
81 alignItems: "center",
82 backgroundColor: bg || "white",
83 }}
84 >
85 <Text>{title}</Text>
86 <Button title="Push screen" onPress={push} />
87 {children}
88 </View>
89 );
90}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected