React Native 'require' gotcha? Works for local image file, but not csv file in same directory
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: a React Native newbie here. Inside my component (inside by App.js file), I'm declaring a variable and setting it to a local CSV file, using require( ) . This errors ---> componentWillMount () { var csvFilePath = require ( './assets/imagesdata.csv' ); However, when I set this to the CSV I want, it gives me an error: Unable to resolve ./ assets / imagesdata . csv " from " . //App.js`: The module `./assets/imagesdata.csv` could not be found" The curious thing is this: if I just sub out the CSV file for another file in the same