const res = fetch("https://api.imgflip.com/get_memes"); if (res.error) return res.error; const templates = []; for (let i = 0; i < res.body.data.memes.length; i++) { const tmp = res.body.data.memes[i]; templates.push( <a href={`${tmp.url}`}> <img src={`${tmp.url}`} height="300" /> <br /> {`${tmp.name}`} <br /> <br /> </a> ); } return ( <div> <h2>Meme templates</h2> <br /> {templates} </div> );