I'm trying to fetch data from a JSON file. I want this file to be in the application, so no fetch on a server, local storage only.
How do I do that?
I search on the internet, and it's either fetch on a server, or add data to AsyncStorage (or similar).
If I were in python, I would simply do this :
import json
data = json.load(open('data.json'))
Then I could use the data as I see fit.
Thanks in advance.
Note : I have the file in JSON, but I could change it to any format that is supported by python (my script for parsing and generating the data is in python).
jsonfile likeconst data = require("./data.json")orimport data from "./data.json"