2017-04-18 397 views
1

我需要检查是否存在文件这样的文件夹中:React Native:有没有办法检查文件是否存在于android_asset文件夹中?

file:///android_asset/contents/my.html 

我试着使用反应本地文件系统插件

componentWillMount() { 
    async function checkIfFileExists() { 
     const fileExists = await FileSystem.fileExists('file:///android_asset/contents/my.html') 
     console.log(`file exists: ${fileExists}`) 
    } 
} 

我敢肯定,my.html文件那里,但我在fileExists中得到了错误。 有人知道如何正确检查它吗?

+0

我认为反应本土无关与此有关。你说的话。 –

回答

相关问题