Skip to content

Commit 009629a

Browse files
authored
Revert "fix: Add support for borderRadii on RectButton (#2691)" (#2746)
## Description Reverts #2691. During testing before release, I've found some cases where the approach from PR doesn't work. At this point it may be better to leave the buttons as they are so we don't break any existing setups, and possibly reuse the logic for pressables.
1 parent c0b6f71 commit 009629a

File tree

4 files changed

+8
-326
lines changed

4 files changed

+8
-326
lines changed

example/src/App.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import ContextMenu from './release_tests/contextMenu';
2121
import NestedTouchables from './release_tests/nestedTouchables';
2222
import NestedButtons from './release_tests/nestedButtons';
2323
import NestedGestureHandlerRootViewWithModal from './release_tests/nestedGHRootViewWithModal';
24-
import RoundedButtons from './release_tests/roundedButtons';
2524
import { PinchableBox } from './recipes/scaleAndRotate';
2625
import PanAndScroll from './recipes/panAndScroll';
2726
import { BottomSheet } from './showcase/bottomSheet';
@@ -120,7 +119,6 @@ const EXAMPLES: ExamplesSection[] = [
120119
{ name: 'Touchables', component: TouchablesIndex as React.ComponentType },
121120
{ name: 'MouseButtons', component: MouseButtons },
122121
{ name: 'ContextMenu (web only)', component: ContextMenu },
123-
{ name: 'Rounded buttons', component: RoundedButtons },
124122
],
125123
},
126124
{

example/src/release_tests/roundedButtons/index.tsx

Lines changed: 0 additions & 138 deletions
This file was deleted.

src/components/GestureButtons.tsx

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import {
66
StyleSheet,
77
StyleProp,
88
ViewStyle,
9-
View,
109
} from 'react-native';
1110

1211
import createNativeWrapper from '../handlers/createNativeWrapper';
@@ -21,7 +20,6 @@ import {
2120
NativeViewGestureHandlerPayload,
2221
NativeViewGestureHandlerProps,
2322
} from '../handlers/NativeViewGestureHandler';
24-
import { splitStyleProp } from './splitStyleProp';
2523

2624
export interface RawButtonProps extends NativeViewGestureHandlerProps {
2725
/**
@@ -65,7 +63,6 @@ export interface RawButtonProps extends NativeViewGestureHandlerProps {
6563
* Set this to true if you don't want the system to play sound when the button is pressed.
6664
*/
6765
touchSoundDisabled?: boolean;
68-
style?: StyleProp<ViewStyle>;
6966
}
7067

7168
export interface BaseButtonProps extends RawButtonProps {
@@ -87,6 +84,7 @@ export interface BaseButtonProps extends RawButtonProps {
8784
* method.
8885
*/
8986
onActiveStateChange?: (active: boolean) => void;
87+
style?: StyleProp<ViewStyle>;
9088
testID?: string;
9189

9290
/**
@@ -220,22 +218,15 @@ export class BaseButton extends React.Component<BaseButtonProps> {
220218
};
221219

222220
render() {
223-
const { rippleColor, style, ...rest } = this.props;
224-
225-
const { outerStyles, innerStyles, restStyles } = splitStyleProp(style);
221+
const { rippleColor, ...rest } = this.props;
226222

227223
return (
228-
<View style={outerStyles}>
229-
<View style={innerStyles}>
230-
<RawButton
231-
rippleColor={processColor(rippleColor)}
232-
style={restStyles}
233-
{...rest}
234-
onGestureEvent={this.onGestureEvent}
235-
onHandlerStateChange={this.onHandlerStateChange}
236-
/>
237-
</View>
238-
</View>
224+
<RawButton
225+
rippleColor={processColor(rippleColor)}
226+
{...rest}
227+
onGestureEvent={this.onGestureEvent}
228+
onHandlerStateChange={this.onHandlerStateChange}
229+
/>
239230
);
240231
}
241232
}

src/components/splitStyleProp.ts

Lines changed: 0 additions & 169 deletions
This file was deleted.

0 commit comments

Comments
 (0)