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

Function MyScreen

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

Source from the content-addressed store, hash-verified

79}
80
81function MyScreen({
82 title,
83 children,
84 bg,
85}: {
86 title: string;
87 children?: React.ReactNode;
88 bg?: string;
89}) {
90 function push() {
91 navigation.stack.push(
92 <Stack.Screen>
93 <MyScreen title="Pushed screen" bg={bg}>
94 <Button title="Pop screen" onPress={pop} />
95 </MyScreen>
96 </Stack.Screen>
97 );
98 }
99
100 function pop() {
101 navigation.stack.pop();
102 }
103
104 return (
105 <View
106 style={{
107 flex: 1,
108 justifyContent: "center",
109 alignItems: "center",
110 backgroundColor: bg || "white",
111 }}
112 >
113 <Text>{title}</Text>
114 <Button title="Push screen" onPress={push} />
115 {children}
116 </View>
117 );
118}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected