From 03b5556716eb04a98b28d66bde8543571c31b2aa Mon Sep 17 00:00:00 2001 From: Ziad Saab Date: Tue, 22 Oct 2024 04:59:22 -0400 Subject: [PATCH] Add React @types to Snap package (#280) Declare this dependency explicitly, as it's currently necessary for the JSX components to work proplerly. The same deps are already in the site package and get hoisted, which unintendedly makes everything work. Co-authored-by: Frederik Bolding --- packages/snap/package.json | 2 ++ yarn.lock | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/packages/snap/package.json b/packages/snap/package.json index aa818de6..6b7913fc 100644 --- a/packages/snap/package.json +++ b/packages/snap/package.json @@ -39,6 +39,8 @@ "@metamask/eslint-config-typescript": "^12.1.0", "@metamask/snaps-cli": "^6.2.1", "@metamask/snaps-jest": "^8.2.0", + "@types/react": "18.2.4", + "@types/react-dom": "18.2.4", "@typescript-eslint/eslint-plugin": "^5.42.1", "@typescript-eslint/parser": "^5.42.1", "eslint": "^8.45.0", diff --git a/yarn.lock b/yarn.lock index 6d91e9af..709a303c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5024,6 +5024,15 @@ __metadata: languageName: node linkType: hard +"@types/react-dom@npm:18.2.4": + version: 18.2.4 + resolution: "@types/react-dom@npm:18.2.4" + dependencies: + "@types/react": "*" + checksum: 8301f35cf1cbfec8c723e9477aecf87774e3c168bd457d353b23c45064737213d3e8008b067c6767b7b08e4f2b3823ee239242a6c225fc91e7f8725ef8734124 + languageName: node + linkType: hard + "@types/react-dom@npm:^18.0.0, @types/react-dom@npm:^18.0.6": version: 18.0.6 resolution: "@types/react-dom@npm:18.0.6" @@ -5044,6 +5053,17 @@ __metadata: languageName: node linkType: hard +"@types/react@npm:18.2.4": + version: 18.2.4 + resolution: "@types/react@npm:18.2.4" + dependencies: + "@types/prop-types": "*" + "@types/scheduler": "*" + csstype: ^3.0.2 + checksum: d920fc93832fe50d5e8175a0ba233086c97a9e238ff7327c8319b8dec57409618f491d6f71be2374c3132f40a8fc428b3e406c1e2a5f1dc32ccd6d47051786d2 + languageName: node + linkType: hard + "@types/responselike@npm:*, @types/responselike@npm:^1.0.0": version: 1.0.0 resolution: "@types/responselike@npm:1.0.0" @@ -16973,6 +16993,8 @@ __metadata: "@metamask/snaps-cli": ^6.2.1 "@metamask/snaps-jest": ^8.2.0 "@metamask/snaps-sdk": ^6.1.1 + "@types/react": 18.2.4 + "@types/react-dom": 18.2.4 "@typescript-eslint/eslint-plugin": ^5.42.1 "@typescript-eslint/parser": ^5.42.1 buffer: ^6.0.3