Skip to content

Commit

Permalink
Simplified repro
Browse files Browse the repository at this point in the history
  • Loading branch information
alduzy committed Aug 21, 2024
1 parent 6a61a6c commit 652b11c
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions apps/src/tests/Test1975.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { View, Text, Button, StyleSheet, Pressable } from 'react-native';
import { View, Text, StyleSheet, Pressable } from 'react-native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';

const Stack = createNativeStackNavigator();
Expand Down Expand Up @@ -34,20 +34,14 @@ function App() {
component={DetailsScreen}
options={({ navigation }) => ({
title: 'Details',
headerLeft: () => (
<Button
onPress={navigation.goBack}
title="Back"
color="#00cc00"
/>
),
headerRight: () => (
<Pressable
onPress={() => {
console.log('doesnt work');
navigation.goBack();
}}>
<Text>Doesnt work</Text>
onPress={navigation.goBack}
style={({ pressed }) => [
styles.pressable,
pressed && { backgroundColor: 'goldenrod' },
]}>
<Text>Go Back</Text>
</Pressable>
),
})}
Expand Down Expand Up @@ -84,7 +78,6 @@ function DetailsScreen() {
}}
onPress={() => {
console.log(`[${counter.current}] Details: onPress`);
// navigation.goBack();
}}
onPressOut={() => {
console.log(`[${counter.current}] Details: onPressOut`);
Expand All @@ -93,7 +86,7 @@ function DetailsScreen() {
styles.pressable,
pressed && { backgroundColor: 'goldenrod' },
]}>
<Text>Go back</Text>
<Text>Press me</Text>
</Pressable>
</View>
);
Expand All @@ -105,10 +98,6 @@ const styles = StyleSheet.create({
paddingHorizontal: 10,
backgroundColor: 'red',
},
count: {
fontSize: 48,
fontWeight: 'bold',
},
container: {
flex: 1,
alignItems: 'center',
Expand Down

0 comments on commit 652b11c

Please sign in to comment.