Created
August 16, 2020 18:23
-
-
Save simicd/e8249fdfe18bf57212aff25672134092 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"}) | |
| 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