Type errors because of types/react~17.
See original GitHub issueSummary
I have created a new project with the typescript template, and I get type errors with the react navigation component.
Stack.Navigator' cannot be used as a JSX component.
Because the current version of react navigation requires types/react~18.
Managed or bare workflow? If you have made manual changes inside of the ios/
or android/
directories in your project, the answer is bare!
managed
What platform(s) does this occur on?
Android, iOS
Package versions
No response
Environment
System: OS: macOS 12.3.1 Shell: 5.8 - /bin/zsh Binaries: Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node Yarn: 1.22.18 - /usr/local/bin/yarn npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm Watchman: 2022.03.21.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 IDEs: Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild npmPackages: expo: ~44.0.0 => 44.0.6 react: 17.0.1 => 17.0.1 react-dom: 17.0.1 => 17.0.1 react-native: 0.64.3 => 0.64.3 react-native-web: 0.17.1 => 0.17.1 npmGlobalPackages: expo-cli: 5.3.1 Expo Workflow: managed
Reproducible demo
https://github.com/expo/expo/tree/main/templates/expo-template-tabs
Stacktrace (if a crash is involved)
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:12 (1 by maintainers)
This is hell, but this helped:
“resolutions”: { “@types/react”: “~17.0.21” },
For those who don’t know (like me before finding out!), add this line on the package.json, on the first level.