microsoft-graph-toolkit icon indicating copy to clipboard operation
microsoft-graph-toolkit copied to clipboard

[BUG] Unable to use templates with <Person> when using typescript due to missing {{person}} object

Open rslavey opened this issue 1 year ago • 0 comments

Describe the bug Using templates with the <Person> element does not work in typescript, as the templateContext is not available and the "person" is not defined

To Reproduce Steps to reproduce the behavior: Create this element <Person className={py-2`} avatarSize="large" view="twolines" line1Property="displayName" templateContext={{ employee }} personQuery={employee?.workEmail ?? ""} personCardInteraction="click"

` the {{person?.displayName}} gives me: Cannot find name 'person'. Did you mean 'Person'?

This example is from https://learn.microsoft.com/en-us/graph/toolkit/components/person?tabs=html

Expected behavior The person object from the templateContext should be available. It seems that a <Template> element is missing that would recognize this context

Screenshots image

Environment (please complete the following information):

  • OS: Windows 11
  • Browser Edgie
  • Framework React spfx
  • Context SharePoint
  • Version 4.3.0
  • Provider "@microsoft/mgt-sharepoint-provider"

Additional context This element works fine with the default <Person> and no template.

rslavey avatar Oct 18 '24 19:10 rslavey