mrded mrded - 1 year ago 1791
JSON Question

How to fetch data from local JSON file on react native?

How can I store local files such as JSON and then fetch the data from controller?

Answer Source

Since React Native 0.4.3 you can read your local JSON file like this:

var customData = require('./customData.json');

and then access customData like a normal JS object.