Skip to content

Commit

Permalink
(migrate-to-next-js) added force dependencies version resolution to d…
Browse files Browse the repository at this point in the history
…owngrade `@types/react` and `@types/react-dom` back to `v17.x.x` because of the breaking changes in version 18 that could not be fixed until either material-ui is upgraded to v5 or this PR (DefinitelyTyped/DefinitelyTyped#59751) is merged

Note this codemod (https://github.com/eps1lon/types-react-codemod) would not help because the errors are caused by library (see this facebook/react#24304 (comment) for the details)

References:
1. https://stackoverflow.com/questions/71810438/compilation-issue-with-react-typescript-and-material-ui-4
2. DefinitelyTyped/DefinitelyTyped#56210 (comment)
3. facebook/react#24304 (comment)
4. https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/
5. facebook/react#24304 (comment)
  • Loading branch information
htbkoo committed Apr 13, 2022
1 parent 8f3a502 commit a8c99c9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
8 changes: 6 additions & 2 deletions package.json
Expand Up @@ -55,8 +55,8 @@
"@types/cheerio": "0.22.30",
"@types/jest": "26.0.20",
"@types/node": "17.0.23",
"@types/react": "18.0.3",
"@types/react-dom": "18.0.0",
"@types/react": "17.0.44",
"@types/react-dom": "17.0.15",
"args": "^5.0.0",
"babel-jest": "27.5.1",
"cross-env": "^5.2.0",
Expand All @@ -72,5 +72,9 @@
"rimraf": "^2.6.3",
"typescript": "4.6.3"
},
"resolutions": {
"@types/react": "17.0.44",
"@types/react-dom": "17.0.15"
},
"license": "MIT"
}
18 changes: 9 additions & 9 deletions yarn.lock
Expand Up @@ -2975,12 +2975,12 @@
resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb"
integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==

"@types/react-dom@18.0.0", "@types/react-dom@^18.0.0":
version "18.0.0"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.0.tgz#b13f8d098e4b0c45df4f1ed123833143b0c71141"
integrity sha512-49897Y0UiCGmxZqpC8Blrf6meL8QUla6eb+BBhn69dTXlmuOlzkfr7HHY/O8J25e1lTUMs+YYxSlVDAaGHCOLg==
"@types/react-dom@17.0.15", "@types/react-dom@^18.0.0":
version "17.0.15"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.15.tgz#f2c8efde11521a4b7991e076cb9c70ba3bb0d156"
integrity sha512-Tr9VU9DvNoHDWlmecmcsE5ZZiUkYx+nKBzum4Oxe1K0yJVyBlfbq7H3eXjxXqJczBKqPGq3EgfTru4MgKb9+Yw==
dependencies:
"@types/react" "*"
"@types/react" "^17"

"@types/react-syntax-highlighter@11.0.5":
version "11.0.5"
Expand All @@ -2996,10 +2996,10 @@
dependencies:
"@types/react" "*"

"@types/react@*", "@types/react@18.0.3":
version "18.0.3"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.3.tgz#baefa397561372015b9f8ba5bc83bc3f84ae8fcb"
integrity sha512-P8QUaMW4k+kH9aKNPl9b3XWcKMSSALYprLL8xpAMJOLUn3Pl6B+6nKC4F7dsk9oJPwkiRx+qlwhG/Zc1LxFVuQ==
"@types/react@*", "@types/react@17.0.44", "@types/react@^17":
version "17.0.44"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.44.tgz#c3714bd34dd551ab20b8015d9d0dbec812a51ec7"
integrity sha512-Ye0nlw09GeMp2Suh8qoOv0odfgCoowfM/9MG6WeRD60Gq9wS90bdkdRtYbRkNhXOpG4H+YXGvj4wOWhAC0LJ1g==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
Expand Down

0 comments on commit a8c99c9

Please sign in to comment.