Skip to content

Instantly share code, notes, and snippets.

@mushfiqweb
Created May 28, 2021 17:09
Show Gist options
  • Select an option

  • Save mushfiqweb/b0858072e4fc12e727f5979cf2ed076d to your computer and use it in GitHub Desktop.

Select an option

Save mushfiqweb/b0858072e4fc12e727f5979cf2ed076d 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 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