What is the proper way to bundle a textfile with the app

时间秒杀一切 提交于 2021-02-11 12:49:01

问题


Using expo, I need to provide a text-file with data (a word-dictionary) to the app. How do I provide that and how do I read it into memory?


回答1:


I translated my textfile to a json-formatted content. This can very easy be used. The json is parsed automatically.

import data from './assets/woerter.json';


来源:https://stackoverflow.com/questions/63104357/what-is-the-proper-way-to-bundle-a-textfile-with-the-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!