Skip to content

Commit cd23206

Browse files
committed
fix: native builds and react conflicts
1 parent 0ffffb9 commit cd23206

10 files changed

Lines changed: 42 additions & 116 deletions

File tree

apps/playground/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"test:harness": "jest --selectProjects react-native-harness"
77
},
88
"dependencies": {
9-
"react": "19.1.1",
10-
"react-dom": "19.1.1",
9+
"react": "19.2.3",
10+
"react-dom": "19.2.3",
1111
"react-native": "0.82.1",
1212
"react-native-web": "^0.21.2"
1313
},
1.08 KB
Loading

packages/runtime/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@
3939
"zustand": "^5.0.5"
4040
},
4141
"devDependencies": {
42-
"@types/chai": "^5.2.2",
43-
"react": "*",
44-
"react-native": "*"
42+
"@types/chai": "^5.2.2"
4543
},
4644
"author": {
4745
"name": "Szymon Chmal",
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import { TurboModuleRegistry, type TurboModule } from 'react-native';
2-
import { type ViewInfo } from '../types.js';
2+
3+
// This interface needs to be there for Codegen to work.
4+
export interface ViewInfo {
5+
x: number;
6+
y: number;
7+
width: number;
8+
height: number;
9+
}
310

411
interface Spec extends TurboModule {
512
simulatePress(x: number, y: number): Promise<void>;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type HarnessUIModule, type ViewInfo } from '../types.js';
1+
import { type HarnessUIModule, type ViewInfo } from './types.js';
22

33
declare global {
44
interface Window {

packages/ui/src/harness.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Platform } from "react-native";
2+
import { HarnessUIModule } from "./types.js";
3+
4+
const getHarnessUI = (): HarnessUIModule => {
5+
if (Platform.OS === 'web') {
6+
return require('./WebHarnessUI.js').default;
7+
}
8+
9+
return require('./NativeHarnessUI.js').default;
10+
}
11+
12+
export default getHarnessUI();

packages/ui/src/harness/index.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

packages/ui/src/screen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { type ViewInfo } from './types.js';
22
import { waitFor } from '@react-native-harness/runtime';
3-
import HarnessUI from './harness/index.js';
3+
import HarnessUI from './harness.js';
44

55
/**
66
* Represents an element found on screen with its position and dimensions.

packages/ui/src/userEvent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import HarnessUI from './harness/index.js';
1+
import HarnessUI from './harness.js';
22
import type { ElementReference } from './screen.js';
33

44
/**

pnpm-lock.yaml

Lines changed: 16 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)