({
title,
showPopButton = false,
bg,
}: {
title: string;
showPopButton?: boolean;
bg?: string;
})
| 62 | } |
| 63 | |
| 64 | function 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected