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