Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
Creating Dog Tinder with API. Not sure what to place as img src.
Post Flair (click to view more posts with a particular flair)
Post Body

const { useState, useEffect } = React;

function App() {
  const [photos, setPhotos] = useState([]);
  fetch("https://dog.ceo/api/breeds/image/random")
    .then((response) => response.json())
    .then((data) => console.log(data));
  return (
    <div className="app">
      <h1>Doggie Speed Dating</h1>
      <h3>
        Press the arrow keys on your keyboard. Left to skip, Right to Adopt.
      </h3>
      <section>
        <div>
          <img className="DogPhotos"></img>
        </div>
        Your HTML Here!
      </section>
    </div>
  );
}

I am trying to make a page for a dog tinder app that refreshes every 10 seconds. However, this API is a little different than the ones I'm used to in the sense that it returns a message as the randomly generated URL instead of set Objects and I'm not sure what to put into the img src. I've tried data.message and response.message but both throw undefined (I'm assuming it as a scope issue).

My console log is throwing the data as expected and as for the refresh trigger for the useEffect, I'm going to use an eventlistener for keyboard presses so it'll refresh the URL if the user presses right or left.

Author
Account Strength
100%
Account Age
5 years
Verified Email
Yes
Verified Flair
No
Total Karma
9,114
Link Karma
553
Comment Karma
8,165
Profile updated: 2 days ago
Posts updated: 1 month ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago