@@ -12,6 +12,8 @@ import {
1212import type { NativeViewGestureHandlerPayload } from '../../handlers/GestureHandlerEventPayload' ;
1313import type { GenericTouchableProps } from './GenericTouchableProps' ;
1414
15+ const AnimatedBaseButton = Animated . createAnimatedComponent ( BaseButton ) ;
16+
1517/**
1618 * Each touchable is a states' machine which preforms transitions.
1719 * On very beginning (and on the very end or recognition) touchable is
@@ -29,6 +31,11 @@ type TouchableState = (typeof TOUCHABLE_STATE)[keyof typeof TOUCHABLE_STATE];
2931
3032interface InternalProps {
3133 onStateChange ?: ( oldState : TouchableState , newState : TouchableState ) => void ;
34+ borderless ?: boolean ;
35+ rippleColor ?: string | number | null ;
36+ rippleRadius ?: number | null ;
37+ foreground ?: boolean ;
38+ exclusive ?: boolean ;
3239}
3340
3441// TODO: maybe can be better
@@ -45,10 +52,8 @@ export default class GenericTouchable extends Component<
4552> {
4653 static defaultProps = {
4754 delayLongPress : 600 ,
48- extraButtonProps : {
49- rippleColor : 'transparent' ,
50- exclusive : true ,
51- } ,
55+ rippleColor : 'transparent' ,
56+ exclusive : true ,
5257 } ;
5358
5459 // Timeout handlers
@@ -248,11 +253,20 @@ export default class GenericTouchable extends Component<
248253 onAccessibilityAction : this . props . onAccessibilityAction ,
249254 nativeID : this . props . nativeID ,
250255 onLayout : this . props . onLayout ,
256+ borderless : this . props . borderless ,
257+ rippleColor : this . props . rippleColor ,
258+ exclusive : this . props . exclusive ,
259+ rippleRadius : this . props . rippleRadius ,
260+ foreground : this . props . foreground ,
261+ // rn-web
262+ className : ( this . props as any ) . className ,
263+ href : ( this . props as any ) . href ,
264+ onClick : ( this . props as any ) . onClick ,
265+ onMouseEnter : ( this . props as any ) . onMouseEnter ,
251266 } ;
252267
253268 return (
254- < BaseButton
255- style = { this . props . containerStyle }
269+ < AnimatedBaseButton
256270 onHandlerStateChange = {
257271 // TODO: not sure if it can be undefined instead of null
258272 this . props . disabled ? undefined : this . onHandlerStateChange
@@ -265,11 +279,10 @@ export default class GenericTouchable extends Component<
265279 testID = { this . props . testID }
266280 touchSoundDisabled = { this . props . touchSoundDisabled ?? false }
267281 enabled = { ! this . props . disabled }
268- { ...this . props . extraButtonProps } >
269- < Animated . View { ...coreProps } style = { this . props . style } >
270- { this . props . children }
271- </ Animated . View >
272- </ BaseButton >
282+ { ...coreProps }
283+ style = { this . props . style } >
284+ { this . props . children }
285+ </ AnimatedBaseButton >
273286 ) ;
274287 }
275288}
0 commit comments