{code}
{hint}
Selection: a task card
Your selection: {selected ? 'selected' : 'unselected'}. Focus another field to keep this selection.
Controlled avatars: editing a card
No tasks. Add a task or reset the list.
)}
{JSON.stringify(value, (key, entry) => (key === 'avatar' ? undefined : entry), 2) ??
'undefined'}
)
}
function ConnectedUsersDemo() {
const me = useMe()
const pagePeers = usePeers()
const workspacePeers = usePeers({ scope: 'workspace' })
const ownIds = me ? [me.id] : []
const pageIds = [...ownIds, ...pagePeers.map(user => user.id)]
const workspaceIds = [...ownIds, ...workspacePeers.map(user => user.id)]
return (
This page
Workspace
Received from the other pane
{presence.map(entry => ({entry.value || '(empty)'}
No presence received yet.
}{label}
Two participants share presence in memory. You control both panes. Alex is on this page, Pierre is on another page, Andrea is away, and David is offline. No server connection is used.