From 5e0c168bb367fd2f6025987d2ca9a8ff6da4936b Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Mon, 27 Nov 2023 13:03:59 +0100 Subject: [PATCH 1/2] fix: add again useIsFocused hook to Button component --- src/components/Button/index.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index 02f743b6a1b6..2576dde9fc61 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -1,3 +1,4 @@ +import {useIsFocused} from '@react-navigation/native'; import React, {ForwardedRef, useCallback} from 'react'; import {ActivityIndicator, GestureResponderEvent, StyleProp, TextStyle, View, ViewStyle} from 'react-native'; import {SvgProps} from 'react-native-svg'; @@ -110,7 +111,6 @@ type ButtonProps = (ButtonWithText | ChildrenProps) & { /** Accessibility label for the component */ accessibilityLabel?: string; - isFocused: boolean; }; function Button( @@ -149,7 +149,6 @@ function Button( shouldRemoveRightBorderRadius = false, shouldRemoveLeftBorderRadius = false, shouldEnableHapticFeedback = false, - isFocused, id = '', accessibilityLabel = '', @@ -159,6 +158,9 @@ function Button( ) { const theme = useTheme(); const styles = useThemeStyles(); + const isFocused = useIsFocused(); + + console.log('isFocused', isFocused); const keyboardShortcutCallback = useCallback( (event?: GestureResponderEvent | KeyboardEvent) => { From 7d5f79684dd63f62f108ffe44cdae5647f9ad21b Mon Sep 17 00:00:00 2001 From: Jakub Butkiewicz Date: Mon, 27 Nov 2023 13:04:38 +0100 Subject: [PATCH 2/2] fix: remove log --- src/components/Button/index.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index 2576dde9fc61..71bce9777174 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -160,8 +160,6 @@ function Button( const styles = useThemeStyles(); const isFocused = useIsFocused(); - console.log('isFocused', isFocused); - const keyboardShortcutCallback = useCallback( (event?: GestureResponderEvent | KeyboardEvent) => { if (!validateSubmitShortcut(isFocused, isDisabled, isLoading, event)) {