Skip to content

Commit bd397a3

Browse files
committed
New Arch requires module to be imported to load
1 parent 3be07c1 commit bd397a3

File tree

3 files changed

+5
-29
lines changed

3 files changed

+5
-29
lines changed

src/NativeOwl.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ import { TurboModuleRegistry } from 'react-native';
33

44
export interface Spec extends TurboModule {}
55

6-
export default TurboModuleRegistry.getEnforcing<Spec>("Owl");
6+
// NOTE: We don't use getEnforcing as we don't have a module on ios
7+
export default TurboModuleRegistry.get<Spec>("Owl");

src/client/client.ts

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ import type { SOCKET_CLIENT_RESPONSE, SOCKET_TEST_REQUEST } from '../websocketTy
1212
import { add, get, type TrackedElementData } from './trackedElements';
1313
import { handleAction } from './handleAction';
1414

15+
// NOTE: On new arch the module isn't autoloaded
16+
import '../NativeOwl';
17+
1518
const logger = new Logger(true);
1619

1720
let isReactUpdating = true;

src/index.ts

-28
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,3 @@
1-
// import { NativeModules } from 'react-native';
2-
//
3-
// const LINKING_ERROR =
4-
// `The package 'react-native-owl' doesn't seem to be linked. Make sure: \n\n` +
5-
// '- You rebuilt the app after installing the package\n' +
6-
// '- You are not using Expo Go\n' +
7-
// '' +
8-
// 'This means your tests on android won\'t be full-screen and you will have\n' +
9-
// 'diff issues with screenshots';
10-
//
11-
// // @ts-expect-error
12-
// const isTurboModuleEnabled = global.__turboModuleProxy != null;
13-
//
14-
// const OwlModule = isTurboModuleEnabled
15-
// ? require('./NativeOwl').default
16-
// : NativeModules.Owl;
17-
//
18-
// OwlModule
19-
// ? OwlModule
20-
// : new Proxy(
21-
// {},
22-
// {
23-
// get() {
24-
// console.error(LINKING_ERROR);
25-
// },
26-
// }
27-
// );
28-
//
291
import './matchers';
302

313
export { takeScreenshot } from './screenshot';

0 commit comments

Comments
 (0)