我对反应本机非常陌生,我正尝试在我正在进行的项目中使用react导航。我试图在我的AuthStackParams.ts中使用AuthStackParams.ts,但是我一直收到一个错误:
.../node_modules/@react-navigation/stack/lib/typescript/src/index has no exported member StackNavigationProp我已经尝试过再次安装@react-navigation/stack,我也尝试过expo start -c,但两者都没有帮助。我希望能就造成这一问题的原因提供任何帮助或建议。谢谢!
AuthStackParams.ts
import { StackNavigationProp } from '@react-navigation/stack';
import { RouteProp } from '@react-navigation/native';
export type AuthStackParams = {
Login: undefined;
};
export type AuthNavProps<T extends keyof AuthStackParams> = {
navigation: StackNavigationProp<AuthStackParams, T>;
route: RouteProp<AuthStackParams, T>;
};package.json
{
"name": "mobile",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"test": "jest --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@apollo/client": "^3.6.9",
"@expo/vector-icons": "^13.0.0",
"@react-native-async-storage/async-storage": "^1.17.10",
"@react-native-community/masked-view": "^0.1.11",
"@react-native-masked-view/masked-view": "0.2.7",
"@react-navigation/bottom-tabs": "^6.0.5",
"@react-navigation/native": "^6.0.13",
"@react-navigation/native-stack": "^6.1.0",
"@react-navigation/stack": "^6.3.0",
"apollo-client": "^2.6.10",
"expo": "~46.0.9",
"expo-asset": "~8.6.1",
"expo-constants": "~13.2.4",
"expo-font": "~10.2.0",
"expo-linking": "~3.2.2",
"expo-permissions": "^13.2.0",
"expo-splash-screen": "^0.16.2",
"expo-status-bar": "~1.4.0",
"expo-system-ui": "~1.3.0",
"expo-web-browser": "~11.0.0",
"graphql": "^15.8.0",
"graphql-ws": "^5.10.1",
"moment": "^2.29.4",
"react": "^18.0.0",
"react-dom": "18.0.0",
"react-native": "^0.69.5",
"react-native-gesture-handler": "~2.5.0",
"react-native-keyboard-accessory": "^0.1.16",
"react-native-safe-area-context": "^4.3.1",
"react-native-screens": "~3.15.0",
"react-native-web": "~0.18.7",
"uuid-random": "^1.3.2",
"ws": "^7.5.9"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/react": "~18.0.0",
"@types/react-native": "~0.69.1",
"jest": "^26.6.3",
"jest-expo": "~44.0.1",
"react-test-renderer": "18.0.0",
"typescript": "~4.3.5"
},
"private": true
}发布于 2022-09-17 07:22:25
版本
https://stackoverflow.com/questions/73752928
复制相似问题