Skip to content

Instantly share code, notes, and snippets.

@mushfiqweb
Created May 28, 2021 17:06
Show Gist options
  • Save mushfiqweb/850f748f6b1be228a7fd5d929ab40b39 to your computer and use it in GitHub Desktop.
Save mushfiqweb/850f748f6b1be228a7fd5d929ab40b39 to your computer and use it in GitHub Desktop.
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