Skip to content

Commit c645ab8

Browse files
committed
fix: channel back navigation issue
1 parent 19b59c6 commit c645ab8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/SampleApp/src/components/ScreenHeader.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,18 @@ export const BackButton: React.FC<{
6464
return (
6565
<TouchableOpacity
6666
onPress={() => {
67+
if (onBack) {
68+
onBack();
69+
return;
70+
}
71+
6772
if (!navigation.canGoBack()) {
6873
// if no previous screen was present in history, go to the list screen
6974
// this can happen when opened through push notification
7075
navigation.reset({ index: 0, routes: [{ name: 'HomeScreen' }] });
7176
} else {
7277
navigation.goBack();
7378
}
74-
if (onBack) {
75-
onBack();
76-
}
7779
}}
7880
style={styles.backButton}
7981
>

0 commit comments

Comments
 (0)