<dd id="3pk9i"><optgroup id="3pk9i"><video id="3pk9i"></video></optgroup></dd>
<rp id="3pk9i"></rp>

<dd id="3pk9i"><track id="3pk9i"></track></dd>
      1. <th id="3pk9i"></th>
        1. <ol id="3pk9i"><ruby id="3pk9i"></ruby></ol>

        2. react navigation報錯怎么辦-快看

          來源:php中文網 | 2022-12-30 11:03:37 |


          【資料圖】

          本教程操作環境:Windows10系統、react18.0.0版、Dell G3電腦。

          react navigation報錯怎么辦?

          react-navigation報錯requireNativeComponent: “RNSScreenStackHeaderConfig“ was not found in the UIManage

          App.tsx代碼:

          import React from "react";import {  SafeAreaView,  ScrollView,  StyleSheet,  Text,  View,} from "react-native";import { NavigationContainer } from "@react-navigation/native";import { createNativeStackNavigator } from "@react-navigation/native-stack"; const Stack = createNativeStackNavigator(); const HomeScreen = () => {  return (    <View>      <Text>首頁</Text>    </View>  )} const MyScreen = () => {  return (    <View>      <Text>我的</Text>    </View>  )} const App = () => {  return (    <NavigationContainer>      <Stack.Navigator initialRouteName="Home">        <Stack.Screen name="Home" component={HomeScreen} />        <Stack.Screen name="Details" component={MyScreen} />      </Stack.Navigator>    </NavigationContainer>  );}; const styles = StyleSheet.create({ }); export default App;

          配置:Stack.Navigator initialRouteName="Home",且配置至少2個Stack.Screen 頁面。

          步驟:然后重啟yarn android。如果仍然報錯requireNativeComponent: "RNSScreenStackHeaderConfig" was not found in the UIManager,則需要刪除android\app\build\outputs\apk\debug目錄下的打包的apk文件,同時刪除模擬器或真機上原有的apk包。然后重新yarn android,生成打包apk,拖到到夜神模擬器,或者真機上測試。

          如果仍然報錯,可能需要反復上面的步驟(這邊反復4次才成功)。

          <Stack.Navigator initialRouteName="Home">   <Stack.Screen name="Home" component={HomeScreen} />   <Stack.Screen name="Details" component={MyScreen} /></Stack.Navigator>

          推薦學習:《react視頻教程》

          以上就是react navigation報錯怎么辦的詳細內容,更多請關注php中文網其它相關文章!

          關鍵詞: react-native

          中文字幕在线观看2021
          <dd id="3pk9i"><optgroup id="3pk9i"><video id="3pk9i"></video></optgroup></dd>
          <rp id="3pk9i"></rp>

          <dd id="3pk9i"><track id="3pk9i"></track></dd>
            1. <th id="3pk9i"></th>
              1. <ol id="3pk9i"><ruby id="3pk9i"></ruby></ol>