2017-04-18 34 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

我認爲反應本土無關與此有關。你說的話。 –

回答

相關問題