Skip to content

Commit 9c17a96

Browse files
committed
type predicate
1 parent 00738d6 commit 9c17a96

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,12 +587,15 @@ export default abstract class GestureHandler implements IGestureHandler {
587587
invokeNullableMethod(onGestureHandlerEvent, cancelEvent);
588588
}
589589

590-
protected ensurePropsRef(): void {
590+
protected ensurePropsRef(): this is this & {
591+
propsRef: React.RefObject<PropsRef>;
592+
} {
591593
if (!this.propsRef) {
592594
throw new Error(
593595
tagMessage('Cannot handle event when component props are null')
594596
);
595597
}
598+
return true;
596599
}
597600

598601
protected transformNativeEvent(): Record<string, unknown> {

0 commit comments

Comments
 (0)