Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Last active August 13, 2022 17:05
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save koss-lebedev/d3cd55237aaea086fb1dfb15786b4eca to your computer and use it in GitHub Desktop.
const useActiveUsers = () => {
const { users } = useUsers()
const activeUsers = useMemo(() => {
return getOnlyActive(users)
}, [users])
return { activeUsers }
}
const ActiveUsersList = () => {
const { activeUsers } = useActiveUsers()
return (
<ul>
{activeUsers.map(user =>
<UserItem key={user.id} user={user} />
)}
</ul>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment