@@ -3,8 +3,6 @@ import { Component } from 'react';
3
3
import {
4
4
Animated ,
5
5
Platform ,
6
- StyleProp ,
7
- ViewStyle ,
8
6
TouchableWithoutFeedbackProps ,
9
7
} from 'react-native' ;
10
8
@@ -18,6 +16,8 @@ import {
18
16
import { NativeViewGestureHandlerPayload } from '../../handlers/NativeViewGestureHandler' ;
19
17
import { TouchableNativeFeedbackExtraProps } from './TouchableNativeFeedback.android' ;
20
18
19
+ const AnimatedBaseButton = Animated . createAnimatedComponent ( BaseButton ) ;
20
+
21
21
/**
22
22
* Each touchable is a states' machine which preforms transitions.
23
23
* On very beginning (and on the very end or recognition) touchable is
@@ -46,8 +46,6 @@ export interface GenericTouchableProps extends TouchableWithoutFeedbackProps {
46
46
nativeID ?: string ;
47
47
shouldActivateOnStart ?: boolean ;
48
48
disallowInterruption ?: boolean ;
49
-
50
- containerStyle ?: StyleProp < ViewStyle > ;
51
49
}
52
50
53
51
interface InternalProps {
@@ -263,8 +261,8 @@ export default class GenericTouchable extends Component<
263
261
} ;
264
262
265
263
return (
266
- < BaseButton
267
- style = { this . props . containerStyle }
264
+ < AnimatedBaseButton
265
+ style = { this . props . style }
268
266
onHandlerStateChange = {
269
267
// TODO: not sure if it can be undefined instead of null
270
268
this . props . disabled ? undefined : this . onHandlerStateChange
@@ -274,11 +272,10 @@ export default class GenericTouchable extends Component<
274
272
shouldActivateOnStart = { this . props . shouldActivateOnStart }
275
273
disallowInterruption = { this . props . disallowInterruption }
276
274
testID = { this . props . testID }
275
+ { ...coreProps }
277
276
{ ...this . props . extraButtonProps } >
278
- < Animated . View { ...coreProps } style = { this . props . style } >
279
- { this . props . children }
280
- </ Animated . View >
281
- </ BaseButton >
277
+ { this . props . children }
278
+ </ AnimatedBaseButton >
282
279
) ;
283
280
}
284
281
}
0 commit comments