Skip to main content

useCollaborators

Get information(including yourself) about collaborators of the environment where the widget is currently running, which include dashboard, datasheet, mirror.

Writing to member field cells using collaborator IDs is not supported at this time.

Note: Since the datasheet can be shared, the id, name, and avatar of the collaborator in the case of not being logged in are undefined.

Returns

{ id: undefined | string ; name: undefined | string ; avatar: undefined | string }[]

Example

import { useCollaborators } from '@apitable/widget-sdk';

// show the currently environment collaborator of the widget
function Meta() {
const collaborators = useCollaborators();
return (<div>
<div>Current collaborator: {collaborators.map(collaborator => {
return <p>{collaborator.name || 'Aliens'}</p>
})}</div>
</div>);
}