import * as React from 'react'; import { Text, View, StyleSheet, Image, Button, Platform } from 'react-native'; import { addMultipleGifs, deleteAllGifs, getSingleGif } from './GifManagement'; // those are Giphy.com ID's - they are hardcoded here, // but if you have Giphy API key - you can use findGifs() from gifFetching.ts const gifIds = ['YsTs5ltWtEhnq', 'cZ7rmKfFYOvYI', '11BCDu2iUc8Nvhryl7']; function AppMain() { //download all gifs at startup React.useEffect(() => { (async () => { await addMultipleGifs(gifIds); })(); //and unload at the end return () => { deleteAllGifs(); }; }, []); //file uri of selected gif const [selectedUri, setUri] = React.useState(null); const handleSelect = async id => { try { setUri(await getSingleGif(id)); } catch (e) { console.error("Couldn't load gif", e); } }; const unloadAll = () => { setUri(null); deleteAllGifs(); }; return ( See contents of gifManagement.ts Select one of the IDs {gifIds.map((item, index) => (