wodin
October 15, 2019, 4:41am
3
By the way, @adamjnav has just posted about how to Lazy Load JSON files. There are similarities to what you’re trying to do, so I though the example might be helpful:
If you’ve ever wondered how to lazy load JSON (useful if you have large JSON files), here’s a quick guide on how to do so:
Give your JSON file a custom extension (we’ll use the extension .lazy then create metro.config.js and add your custom extension to the assetExts:
const { getDefaultConfig } = require("metro-config");
module.exports = (async () => {
const {
resolver: { sourceExts, assetExts }
} = await getDefaultConfig();
return {
resolver: {
assetExts: [...assetExts…