Created
May 28, 2021 17:09
-
-
Save mushfiqweb/b0858072e4fc12e727f5979cf2ed076d 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 Loader from '../components/Loader' | |
| import UserError from '../components/UserError' | |
| import useUser from '../hooks/useUser'; | |
| const Header = ({ id }) => { | |
| const { user, error, loading } = useUser(id); | |
| if (loading) return <Loader /> | |
| if (error) return <UserError /> | |
| return <div> | |
| <Avatar img={user.imageUrl} /> | |
| ... | |
| </div> | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment