错误:错误:无法从D:\React Native实践\app1\App.tsx解析模块@React导航/本机:在项目或以下目录中找不到@react-navigation/native:
我的代码:
import React from "react";
import { View, Text, StyleSheet, ScrollView, SafeAreaView, TextInput, TouchableOpacity } from "react-native";
import { useNavigation } from '@react-navigation/native';
import Icon from 'react-native-vector-icons/FontAwesome';
import Ionicons from 'react-native-vector-icons/Ionicons';
import Button from './components/Button';
import InputFeild from './components/InputFeild';
const App = () =>{
const navigation = useNavigation();
return(
<SafeAreaView style={styles.container}>
<View style={styles.emptyProfile}>
<Ionicons name="person-outline" size={50}/>
</View>
<View style={styles.inputFeilds}>
<InputFeild name="user_name" banner="at-outline" secutiry={false}/>
<InputFeild name="password" banner="lock-closed-outline" secutiry={true}/>
</View>
<View style={styles.actions}>
<Button buttonIcon="log-in-outline" text="Sign In" buttonActivated={true}/>
<Button buttonIcon="person-add-outline" text="New user? Sign Up" buttonActivated={false}
onPress={() => {
}}
/>
</View>
</SafeAreaView>
);
};
export default App;
1条答案
按热度按时间4xrmg8kj1#
在您的项目中安装这些软件包并重新启动项目
npm install @react-navigation/native
查看这些文档https://reactnavigation.org/docs/getting-started/