Last active
July 5, 2020 03:04
-
-
Save treyhuffine/3b8a82a7c72fcff4708feb7e9eb56729 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 * as React from 'react'; | |
import useFriendStatus from './useFriendStatus'; | |
interface IUser { | |
id: number; | |
username: string; | |
} | |
const FriendsListItem ({ user }) => { | |
// We know this value is a boolean since we defined our hook | |
const isOnline = useFriendStatus(user.id); | |
return ( | |
<li> | |
<span style={{ backgroundColor: isOnline ? 'green' : 'red }} /> | |
<span> | |
{user.username} | |
</span> | |
<li> | |
); | |
}; |
On line 11; hook call should be
useFriendStatus
instead ofuserFriendStatus
with a reduntant r letter.
Thanks! It's been fixed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
On line 11; hook call should be
useFriendStatus
instead ofuserFriendStatus
with a reduntant r letter.