Skip to content

Commit 4d916f5

Browse files
committed
removed type predicate
1 parent 1f62d5c commit 4d916f5

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

packages/react-native-gesture-handler/src/web/handlers/GestureHandler.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default abstract class GestureHandler implements IGestureHandler {
3131
private _enabled = false;
3232

3333
private viewRef: number | null = null;
34-
protected propsRef: React.RefObject<PropsRef> | null = null;
34+
private propsRef: React.RefObject<PropsRef> | null = null;
3535
private actionType: ActionType | null = null;
3636
private forAnimated: boolean | null = null;
3737
private _handlerTag!: number;
@@ -363,7 +363,7 @@ export default abstract class GestureHandler implements IGestureHandler {
363363
}
364364
this.ensurePropsRef();
365365
const { onGestureHandlerEvent, onGestureHandlerTouchEvent }: PropsRef =
366-
this.propsRef.current;
366+
this.propsRef!.current;
367367

368368
const touchEvent: ResultTouchEvent | undefined =
369369
this.transformTouchEvent(event);
@@ -390,7 +390,7 @@ export default abstract class GestureHandler implements IGestureHandler {
390390
onGestureHandlerEvent,
391391
onGestureHandlerStateChange,
392392
onGestureHandlerAnimatedEvent,
393-
}: PropsRef = this.propsRef.current;
393+
}: PropsRef = this.propsRef!.current;
394394
const resultEvent: ResultEvent = this.transformEventData(
395395
newState,
396396
oldState
@@ -580,14 +580,12 @@ export default abstract class GestureHandler implements IGestureHandler {
580580
timeStamp: Date.now(),
581581
};
582582

583-
const { onGestureHandlerEvent }: PropsRef = this.propsRef.current;
583+
const { onGestureHandlerEvent }: PropsRef = this.propsRef!.current;
584584

585585
invokeNullableMethod(onGestureHandlerEvent, cancelEvent);
586586
}
587587

588-
protected ensurePropsRef(): asserts this is this & {
589-
propsRef: React.RefObject<PropsRef>;
590-
} {
588+
protected ensurePropsRef(): void {
591589
if (!this.propsRef) {
592590
throw new Error(
593591
tagMessage('Cannot handle event when component props are null')

0 commit comments

Comments
 (0)