@@ -31,7 +31,7 @@ export default abstract class GestureHandler implements IGestureHandler {
31
31
private _enabled = false ;
32
32
33
33
private viewRef : number | null = null ;
34
- private propsRef : React . RefObject < PropsRef > | null = null ;
34
+ protected propsRef : React . RefObject < PropsRef > | null = null ;
35
35
private actionType : ActionType | null = null ;
36
36
private forAnimated : boolean | null = null ;
37
37
private _handlerTag ! : number ;
@@ -365,7 +365,7 @@ export default abstract class GestureHandler implements IGestureHandler {
365
365
}
366
366
this . ensurePropsRef ( ) ;
367
367
const { onGestureHandlerEvent, onGestureHandlerTouchEvent } : PropsRef =
368
- this . propsRef ! . current ;
368
+ this . propsRef . current ;
369
369
370
370
const touchEvent : ResultTouchEvent | undefined =
371
371
this . transformTouchEvent ( event ) ;
@@ -392,7 +392,7 @@ export default abstract class GestureHandler implements IGestureHandler {
392
392
onGestureHandlerEvent,
393
393
onGestureHandlerStateChange,
394
394
onGestureHandlerAnimatedEvent,
395
- } : PropsRef = this . propsRef ! . current ;
395
+ } : PropsRef = this . propsRef . current ;
396
396
const resultEvent : ResultEvent = this . transformEventData (
397
397
newState ,
398
398
oldState
@@ -582,20 +582,19 @@ export default abstract class GestureHandler implements IGestureHandler {
582
582
timeStamp : Date . now ( ) ,
583
583
} ;
584
584
585
- const { onGestureHandlerEvent } : PropsRef = this . propsRef ! . current ;
585
+ const { onGestureHandlerEvent } : PropsRef = this . propsRef . current ;
586
586
587
587
invokeNullableMethod ( onGestureHandlerEvent , cancelEvent ) ;
588
588
}
589
589
590
- protected ensurePropsRef ( ) : this is this & {
590
+ protected ensurePropsRef ( ) : asserts this is this & {
591
591
propsRef : React . RefObject < PropsRef > ;
592
592
} {
593
593
if ( ! this . propsRef ) {
594
594
throw new Error (
595
595
tagMessage ( 'Cannot handle event when component props are null' )
596
596
) ;
597
597
}
598
- return true ;
599
598
}
600
599
601
600
protected transformNativeEvent ( ) : Record < string , unknown > {
0 commit comments