'how to render remote .json lottie files in react native? .json files are up on the cloud

for ex: now we do :

const ex = { somejson: require('../something/ex.json }

and then call ex where we want to use it.

We have too many .json files that take up significant space and to reduce this, we plan to move our .json files up to the cloud and then render the lottie files remotely. I tried using dotlottie as well for space optimization but yeah, we decided to go for .json only. Now, how do I render the files remotely?



Solution 1:[1]

you would need to do a HTTP GET request with the FETCH API or Axios for example.

https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch https://www.npmjs.com/package/axios

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Curky