Created
November 9, 2019 22:09
-
-
Save franckjay/30551e12ccb1625b52987a414c204672 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
import React, { useState, useEffect } from 'react'; | |
import { Image } from "semantic-ui-react"; | |
export const GrabBook = ()=> { | |
const [outputURL, setOutputURL] = useState(""); | |
useEffect(() => { | |
fetch("/novel_novel").then(response => | |
response.json().then(data => { | |
setOutputURL(data.image_url); | |
}) | |
); | |
}, []); | |
const BookImage = () => (<Image src={outputURL} size='small' />) | |
console.log("reponse") | |
console.log(outputURL) | |
return( | |
<BookImage/> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment