Last active
November 22, 2021 12:05
-
-
Save hieptl/f465b182c83cf925d585654d96f45864 to your computer and use it in GitHub Desktop.
Server.js - Discord Clone
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 { useEffect, useContext } from 'react'; | |
import Sidebars from './Sidebars'; | |
import Main from './Main'; | |
import Context from '../../context'; | |
const Server = () => { | |
const { setSelectedChannel } = useContext(Context); | |
useEffect(() => { | |
return () => { | |
setSelectedChannel(null); | |
} | |
}, [setSelectedChannel]); | |
return ( | |
<div className="server__container"> | |
<Sidebars /> | |
<Main /> | |
</div> | |
); | |
}; | |
export default Server; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment