Skip to content

Commit b93e3c8

Browse files
fix: add @types/react dependencies for TypeScript compilation
- Add @types/react to root package.json for react-native type declarations - Add @types/react to design-system-shared for ReactNode type imports - Add @types/react to design-system-twrnc-preset devDependencies - Fix design-system-twrnc-preset tsconfig to use jsx: react instead of react-native - Remove accidental @testing-library/dom declarations from global.d.ts
1 parent cb77b92 commit b93e3c8

6 files changed

Lines changed: 8 additions & 16 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"@types/jest": "^27.4.1",
9797
"@types/lodash": "^4.14.191",
9898
"@types/node": "^16.18.54",
99+
"@types/react": "^18.2.0",
99100
"@types/semver": "^7",
100101
"@typescript-eslint/eslint-plugin": "^8.7.0",
101102
"@typescript-eslint/parser": "^8.7.0",

packages/design-system-react/global.d.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,3 @@ declare module '*.svg' {
1010
const src: string;
1111
export default src;
1212
}
13-
14-
declare module '@testing-library/dom' {
15-
export type Queries = any;
16-
export type BoundFunction<T = any> = (...args: any[]) => any;
17-
export const queries: Queries;
18-
export const screen: any;
19-
export const fireEvent: any;
20-
export function waitFor<T = any>(callback: () => T, options?: any): Promise<T>;
21-
export function waitForElementToBeRemoved<T = any>(callback: () => T, options?: any): Promise<void>;
22-
export function act(fn: () => any): Promise<any> | void;
23-
export function within(...args: any[]): any;
24-
export function configure(options: any): void;
25-
export function getConfig(): any;
26-
}

packages/design-system-shared/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"@metamask/auto-changelog": "^5.3.2",
5353
"@ts-bridge/cli": "^0.6.3",
5454
"@types/jest": "^27.4.1",
55+
"@types/react": "^18.2.0",
5556
"deepmerge": "^4.2.2",
5657
"jest": "^29.7.0",
5758
"ts-jest": "^29.2.5",

packages/design-system-twrnc-preset/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"@ts-bridge/cli": "^0.6.3",
7070
"@types/babel__preset-env": "^7",
7171
"@types/jest": "^27.4.1",
72+
"@types/react": "^18.2.0",
7273
"@types/react-test-renderer": "^18",
7374
"babel-jest": "^29.7.0",
7475
"deepmerge": "^4.2.2",

packages/design-system-twrnc-preset/tsconfig.build.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"baseUrl": "./",
55
"outDir": "./dist",
66
"rootDir": "./src",
7-
"jsx": "react-native",
8-
"types": ["react-native", "jest"],
7+
"jsx": "react",
8+
"types": ["jest"],
99
"emitDeclarationOnly": false
1010
},
1111
"references": [{ "path": "../design-tokens/tsconfig.build.json" }],

yarn.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3508,6 +3508,7 @@ __metadata:
35083508
"@metamask/utils": "npm:^11.10.0"
35093509
"@ts-bridge/cli": "npm:^0.6.3"
35103510
"@types/jest": "npm:^27.4.1"
3511+
"@types/react": "npm:^18.2.0"
35113512
deepmerge: "npm:^4.2.2"
35123513
jest: "npm:^29.7.0"
35133514
ts-jest: "npm:^29.2.5"
@@ -3548,6 +3549,7 @@ __metadata:
35483549
"@ts-bridge/cli": "npm:^0.6.3"
35493550
"@types/babel__preset-env": "npm:^7"
35503551
"@types/jest": "npm:^27.4.1"
3552+
"@types/react": "npm:^18.2.0"
35513553
"@types/react-test-renderer": "npm:^18"
35523554
babel-jest: "npm:^29.7.0"
35533555
deepmerge: "npm:^4.2.2"
@@ -3675,6 +3677,7 @@ __metadata:
36753677
"@types/jest": "npm:^27.4.1"
36763678
"@types/lodash": "npm:^4.14.191"
36773679
"@types/node": "npm:^16.18.54"
3680+
"@types/react": "npm:^18.2.0"
36783681
"@types/semver": "npm:^7"
36793682
"@typescript-eslint/eslint-plugin": "npm:^8.7.0"
36803683
"@typescript-eslint/parser": "npm:^8.7.0"

0 commit comments

Comments
 (0)