简体   繁体   中英

Possible Unhandled Promise Rejection (id:143)

I'm new to using react native to build the application, i tried to display an array using flatlist, it can successfully show the data, but the warning message are shown.

[Unhandled promise rejection: Error: Directory for "" doesn't exist. Please make sure directory '' exists before calling downloadAsync.]
at node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:104:50 in promiseMethodWrapper
at node_modules/expo-modules-core/build/NativeModulesProxy.native.js:15:23 in moduleName.methodInfo.name
at node_modules/expo-file-system/build/FileSystem.js:105:17 in downloadAsync
at node_modules/expo-file-system/build/FileSystem.js:101:7 in downloadAsync
at node_modules/expo-asset/build/PlatformUtils.js:49:25 in _downloadAsyncManagedEnv

and my code is below

       <View>
 
 <FlatList
          data = {result}
          keyExtractor={(item) => item.Code}
          renderItem={({item}) => 
        <View>

          <List.Item
    title={item.Title}
    description={item.Code}

>
</List.Item>


        </View>  
        
        }
          />


              </View>

Navigate to your iPhone simulator and do the following:

Device -> Erase All Content and Settings

Then restart your server and start it up again using the expo go app, you should be good to go.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM