({
title,
children,
bg,
}: {
title: string;
children?: React.ReactNode;
bg?: string;
})
| 79 | } |
| 80 | |
| 81 | function 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected