mrded mrded - 5 months ago 782
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

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.

Comments