Skip to content

Commit b10b28e

Browse files
Remove extra wrapper view from GenericTouchable
1 parent 36b622d commit b10b28e

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

src/components/touchables/GenericTouchable.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ import { BaseButton } from '../GestureButtons';
1414
import {
1515
GestureEvent,
1616
HandlerStateChangeEvent,
17-
} from '../../handlers/gestureHandlerCommon';
17+
} from '../../handlers/gestureHandlers';
1818
import { NativeViewGestureHandlerPayload } from '../../handlers/NativeViewGestureHandler';
1919
import { TouchableNativeFeedbackExtraProps } from './TouchableNativeFeedback.android';
2020

21+
const AnimatedBaseButton = Animated.createAnimatedComponent(BaseButton);
22+
2123
/**
2224
* Each touchable is a states' machine which preforms transitions.
2325
* On very beginning (and on the very end or recognition) touchable is
@@ -46,8 +48,6 @@ export interface GenericTouchableProps extends TouchableWithoutFeedbackProps {
4648
nativeID?: string;
4749
shouldActivateOnStart?: boolean;
4850
disallowInterruption?: boolean;
49-
50-
containerStyle?: StyleProp<ViewStyle>;
5151
}
5252

5353
interface InternalProps {
@@ -263,8 +263,8 @@ export default class GenericTouchable extends Component<
263263
};
264264

265265
return (
266-
<BaseButton
267-
style={this.props.containerStyle}
266+
<AnimatedBaseButton
267+
style={this.props.style}
268268
onHandlerStateChange={
269269
// TODO: not sure if it can be undefined instead of null
270270
this.props.disabled ? undefined : this.onHandlerStateChange
@@ -274,11 +274,10 @@ export default class GenericTouchable extends Component<
274274
shouldActivateOnStart={this.props.shouldActivateOnStart}
275275
disallowInterruption={this.props.disallowInterruption}
276276
testID={this.props.testID}
277+
{...coreProps}
277278
{...this.props.extraButtonProps}>
278-
<Animated.View {...coreProps} style={this.props.style}>
279279
{this.props.children}
280-
</Animated.View>
281-
</BaseButton>
280+
</AnimatedBaseButton>
282281
);
283282
}
284283
}

0 commit comments

Comments
 (0)