@atlaskit/avatar
Version:
An avatar is a visual representation of a user or entity.
8 lines • 333 B
JavaScript
import { useContext } from 'react';
import { EnsureIsInsideAvatarContext } from './ensure-is-inside-avatar-context';
export const useEnsureIsInsideAvatar = () => {
const context = useContext(EnsureIsInsideAvatarContext);
if (!context) {
throw new Error('Avatar sub-components must be used within a Avatar component.');
}
};