Skip to content

Commit 412fb0c

Browse files
kosmydelcursoragent
andcommitted
[General] Default GestureDetector moduleId to -1
Codegen's implicit Int32 default is 0, which is also the first RNGestureHandlerModule id. Props 2.0 diffs CREATE against that default and omits moduleId, so Android never calls setModuleId and the view stays at -1. Looking up registries[-1] then crashes on child remove. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent bd85331 commit 412fb0c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/react-native-gesture-handler/src/specs/RNGestureHandlerDetectorNativeComponent.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export interface NativeProps extends ViewProps {
6767
| undefined;
6868

6969
handlerTags: CodegenTypes.Int32[];
70-
moduleId: CodegenTypes.Int32;
70+
moduleId?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
7171
virtualChildren: VirtualChildrenProps[];
7272

7373
pointerEvents?: CodegenTypes.WithDefault<

‎packages/react-native-gesture-handler/src/specs/RNGestureHandlerRootViewNativeComponent.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface RootViewNativeProps extends ViewProps {
77
}
88

99
interface NativeProps extends ViewProps {
10-
moduleId: CodegenTypes.Int32;
10+
moduleId?: CodegenTypes.WithDefault<CodegenTypes.Int32, -1>;
1111
unstable_forceActive?: boolean;
1212
}
1313

0 commit comments

Comments
 (0)