Created
May 28, 2021 17:06
-
-
Save mushfiqweb/850f748f6b1be228a7fd5d929ab40b39 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 UserProfile = ({ id }) => { | |
const { user, error, loading } = useUser(id); | |
if (loading) return <Loader /> | |
if (error) return <UserError /> | |
return <div> | |
<h1>{user.name}</h1> | |
... | |
</div> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment