Last active
July 30, 2021 03:02
-
-
Save MeetMartin/b96bf078ba895e608f1b70ca70050cbf 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
// /src/pages/HomePage.js | |
import React, { useContext, useEffect } from 'react'; | |
import { StoreContext } from '../store/StoreContext'; | |
import { QuoteComponent, Background, Footer } from '../components'; | |
const HomePage = () => { | |
const { state, actions } = useContext(StoreContext); | |
useEffect(() => { | |
setInterval(actions.requestRandomQuote, 10000); | |
}, []); | |
return ( | |
<> | |
<Background /> | |
<QuoteComponent quote={state.quote} author={state.author} /> | |
<Footer /> | |
</> | |
); | |
}; | |
export default HomePage; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment