useProfiles

useProfile<T>(
  loginName: string,
  options?: ProfileOptions,
  deps?: any[]): T | null | undefined;

Returns an user profile for specified login name or email.

Examples

Get profile by user email,

const profileByEmail = useProfile("user@example.onmicrosoft.com");

Get profile by user login name,

const profile = useProfile("i:0#.f|membership|user@example.onmicrosoft.com");

Parameters

NameTypeDescriptionTracked for changes
loginNamestringUser login name or emailYes
options?ProfileOptionsuseProfile hook optionsPartially
deps?DependencyListHook dependency list.Yes