Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,12 @@
/**
* @deprecated use `BaseButton` instead
*/
export const LegacyBaseButton = React.forwardRef<

Check warning on line 147 in packages/react-native-gesture-handler/src/components/GestureButtons.tsx

View workflow job for this annotation

GitHub Actions / check

In React 19, 'forwardRef' is no longer necessary. Pass 'ref' as a prop instead
React.ComponentType,
Omit<LegacyBaseButtonProps, 'innerRef'>
>((props, ref) => <InnerBaseButton innerRef={ref} {...props} />);

Check warning on line 150 in packages/react-native-gesture-handler/src/components/GestureButtons.tsx

View workflow job for this annotation

GitHub Actions / check

Add missing 'displayName' for component

const AnimatedBaseButton = React.forwardRef<

Check warning on line 152 in packages/react-native-gesture-handler/src/components/GestureButtons.tsx

View workflow job for this annotation

GitHub Actions / check

In React 19, 'forwardRef' is no longer necessary. Pass 'ref' as a prop instead
React.ComponentType,
Animated.AnimatedProps<BaseButtonWithRefProps>
>((props, ref) => <AnimatedInnerBaseButton innerRef={ref} {...props} />);
Expand Down Expand Up @@ -228,6 +228,7 @@
static defaultProps = {
activeOpacity: 0.3,
borderless: true,
foreground: true,
};

private opacity: Animated.Value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ export interface ButtonProps extends ViewProps, AccessibilityProps {
export const ButtonComponent =
RNGestureHandlerButtonNativeComponent as HostComponent<ButtonProps>;

export default function GestureHandlerButton({ style, ...rest }: ButtonProps) {
export default function GestureHandlerButton({
borderless,
style,
...rest
}: ButtonProps) {
const flattenedStyle = useMemo(() => StyleSheet.flatten(style), [style]);

const {
Expand Down Expand Up @@ -222,10 +226,16 @@ export default function GestureHandlerButton({ style, ...rest }: ButtonProps) {
collapsable={false}
style={[
styles.contents,
(!overflow || overflow === 'hidden') && styles.overflowHidden,
!borderless &&
(!overflow || overflow === 'hidden') &&
styles.overflowHidden,
restStyle,
]}>
<ButtonComponent {...rest} style={layoutStyle} />
<ButtonComponent
{...rest}
style={layoutStyle}
borderless={borderless}
/>
</View>
</RNGestureHandlerButtonWrapperNativeComponent>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ export const BorderlessButton = (props: BorderlessButtonProps) => {

return (
<AnimatedBaseButton
borderless
foreground
{...rest}
onActiveStateChange={onActiveStateChange}
style={[style, Platform.OS === 'ios' && { opacity }]}>
Expand Down
Loading