Skip to content

Commit

Permalink
Fix issues with rn 0.74 bridgeless (#3535)
Browse files Browse the repository at this point in the history
* Fix empty native module

* Fix onPress type
  • Loading branch information
janicduplessis authored Jun 18, 2024
1 parent 32b7ce4 commit b74fc6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/RNMBXModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ interface RNMBXModule {
setConnected(connected: boolean): void;
}

const RNMBXModule: RNMBXModule = { ...NativeModules.RNMBXModule };
// eslint-disable-next-line prefer-destructuring
const RNMBXModule: RNMBXModule = NativeModules.RNMBXModule;
if (NativeModules.RNMBXModule == null) {
if ((global as { expo?: unknown }).expo != null) {
// global.expo.modules.ExponentConstants;
Expand Down
3 changes: 2 additions & 1 deletion src/specs/RNMBXMapViewNativeComponent.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { HostComponent, ViewProps } from 'react-native';
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
import {
BubblingEventHandler,
DirectEventHandler,
Int32,
} from 'react-native/Libraries/Types/CodegenTypes';
Expand Down Expand Up @@ -72,7 +73,7 @@ export interface NativeProps extends ViewProps {
// iOS only
compassImage?: OptionalProp<string>;

onPress?: DirectEventHandler<OnPressEventType>;
onPress?: BubblingEventHandler<OnPressEventType>;
onLongPress?: DirectEventHandler<OnPressEventType>;
onMapChange?: DirectEventHandler<OnMapChangeEventType>;
onCameraChanged?: DirectEventHandler<OnCameraChangedEventType>;
Expand Down

0 comments on commit b74fc6f

Please sign in to comment.