Skip to content

Commit

Permalink
Adding error navigate
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyrichmond committed Apr 21, 2024
1 parent fa822e8 commit 170b585
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cake-game/src/routes/play/Play.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import { useEffect, useState } from "react";
import { useNavigate } from 'react-router-dom';

import axios from "axios";

import "./Play.css";

function Play() {
const navigate = useNavigate();

const [imageUrl, setImageUrl] = useState();
const [expectedCategory, setExpectedCategory] = useState('cake');

Expand All @@ -20,9 +24,6 @@ function Play() {
if (response.status !== 200) {
throw new Error('Unable to get next image');
}
//const result = await response.json();

console.log(response.data);

const imageUrl = response.data.image_url;
const category = response.data.category;
Expand Down

0 comments on commit 170b585

Please sign in to comment.