Last active
August 16, 2020 18:27
-
-
Save simicd/1199f2deb9c717a667cf20cf51f37d30 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // DogImage.tsx | |
| import React, { FC } from "react"; | |
| import { useFetch } from "./useFetch"; | |
| export const DogImage: FC = () => { | |
| const data = useFetch({ url: "https://dog.ceo/api/breed/beagle/images/random", init: {}}) | |
| return <>{data ? <img src={data.message} alt="dog"></img> : <div>Loading</div>}</>; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment