Created
June 30, 2020 11:18
-
-
Save moshfeu/406ee08315f6cc5b83707f1b8cd019a6 to your computer and use it in GitHub Desktop.
This file contains 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
const App = () => { | |
const [isLoadgin, setIsLoading] = useState(true) | |
const [cardInfo, setCardInfo] = useContext(CardInfoContext) | |
useEffect(() => { | |
fetchData(result => { | |
setCardInfo(result); | |
setIsLoading(false); | |
}) | |
}, []) | |
return ( | |
<> | |
<div className="app"> | |
{isLoading && <h1 className="loadingNotice">Fetching data...</h1>} | |
{ | |
cardInfo.map(card => <img src={card.image} />) | |
} | |
</div> | |
</> | |
)} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment