diff --git a/apps/common-app/src/new_api/components/buttons/index.tsx b/apps/common-app/src/new_api/components/buttons/index.tsx index f7b0a48d0b..655a75951f 100644 --- a/apps/common-app/src/new_api/components/buttons/index.tsx +++ b/apps/common-app/src/new_api/components/buttons/index.tsx @@ -29,7 +29,7 @@ function ButtonWrapper({ - feedback?.current?.showMessage(`[${ButtonComponent.name}] onLongPress`) + feedback?.current?.showMessage(`[${ButtonComponent.name}] onPress`) } onLongPress={() => { feedback?.current?.showMessage(`[${ButtonComponent.name}] onLongPress`); diff --git a/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx b/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx index 7f265f72bb..178293b68a 100644 --- a/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx +++ b/packages/react-native-gesture-handler/src/components/GestureHandlerButton.tsx @@ -70,7 +70,7 @@ export interface ButtonProps extends ViewProps, AccessibilityProps { /** * Invoked on mount and layout changes. */ - onLayout?: (event: LayoutChangeEvent) => void; + onLayout?: ((event: LayoutChangeEvent) => void) | undefined; /** * Used for testing-library compatibility, not passed to the native component. @@ -101,7 +101,7 @@ export interface ButtonProps extends ViewProps, AccessibilityProps { testOnly_onLongPress?: Function | null | undefined; } -const ButtonComponent = +export const ButtonComponent = RNGestureHandlerButtonNativeComponent as HostComponent; export default function GestureHandlerButton({ style, ...rest }: ButtonProps) { diff --git a/packages/react-native-gesture-handler/src/components/GestureHandlerButton.web.tsx b/packages/react-native-gesture-handler/src/components/GestureHandlerButton.web.tsx index 3f9292d614..72efc29f59 100644 --- a/packages/react-native-gesture-handler/src/components/GestureHandlerButton.web.tsx +++ b/packages/react-native-gesture-handler/src/components/GestureHandlerButton.web.tsx @@ -1,6 +1,12 @@ import * as React from 'react'; -import { View } from 'react-native'; +import { View, ViewProps } from 'react-native'; -export default React.forwardRef>( - (props, ref) => +type ButtonProps = ViewProps & { + ref?: React.Ref>; +}; + +export const ButtonComponent = (props: ButtonProps) => ( + ); + +export default ButtonComponent; diff --git a/packages/react-native-gesture-handler/src/components/Pressable/Pressable.tsx b/packages/react-native-gesture-handler/src/components/Pressable/Pressable.tsx index f1abc78a78..26ab9e27e0 100644 --- a/packages/react-native-gesture-handler/src/components/Pressable/Pressable.tsx +++ b/packages/react-native-gesture-handler/src/components/Pressable/Pressable.tsx @@ -19,7 +19,7 @@ import { StyleProp, ViewStyle, } from 'react-native'; -import NativeButton from '../GestureHandlerButton'; +import { ButtonComponent as NativeButton } from '../GestureHandlerButton'; import { gestureToPressableEvent, addInsets,