Modul „react-native-safe-area-context' nicht gefunden
P粉928591383
P粉928591383 2024-03-20 09:03:29
0
1
506

Ich lerne React Native. Ich versuche, SafeAreaProvider und SafeAreaView zu verwenden, aber wenn ich das mache:

import { SafeAreaProvider, SafeAreaView } from "react-native-safe-area-context";

Ich habe die Meldung erhalten, dass das Modul „react-native-safe-area-context“ nicht gefunden wurde

Das ist meine Version:

"dependencies": {
    "@react-native-community/masked-view": "^0.1.11",
    "expo": "~48.0.18",
    "expo-status-bar": "~1.4.4",
    "react": "18.2.0",
    "react-native": "0.71.8",
    "react-native-safe-area-context": "4.5.0",
    "react-navigation": "^4.4.4"

Kannst du mir helfen? Vielen Dank!

Ich habe versucht, den React-Native-Safe-Area-Context von 4.7.1 auf 4.5 herunterzustufen

P粉928591383
P粉928591383

Antworte allen(1)
P粉593649715

您收到了错误消息“找不到模块'react-native-safe-area-context'”,这是因为在您的环境中未安装SafeAreaContext库。

该库已包含在Expo Go中,但如果您使用的是NPM,则应按照此处的说明进行操作。

在您的环境终端中运行以下命令以在本地安装库:

- npx expo install react-native-safe-area-context

如果该命令不起作用,请尝试使用以下命令:

npx expo install react-native-screens react-native-safe-area-context
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage