【发布时间】:2017-04-18 11:33:39
【问题描述】:
我需要像这样检查文件夹中的文件是否存在:
file:///android_asset/contents/my.html
我尝试过使用 react-native-filesystem 插件
componentWillMount () {
async function checkIfFileExists() {
const fileExists = await FileSystem.fileExists('file:///android_asset/contents/my.html')
console.log(`file exists: ${fileExists}`)
}
}
我确定 my.html 文件在那里,但我在 fileExists 中得到错误。 有人知道如何正确检查吗?
【问题讨论】:
-
我认为 react native 与此无关。你说什么。
标签: javascript android react-native