Working example for Graph Toolkit using SharePoint spfx, React and Get component with template

前端 未结 1 1522
栀梦
栀梦 2021-01-27 16:33

I\'m trying to make use of the Microsoft Graph Toolkit inside my SharePoint spfx web part solution, and more specifically the React version (@microsoft/mgt-react).

I\'ve

相关标签:
1条回答
  • 2021-01-27 16:50

    The props.dataContext doesn't have a person property but is the person object itself, try changing your MyPerson definition to:

    const MyPerson = (props: MgtTemplateProps) => {
      const person = props.dataContext;
      return <Person userId={person.userPrincipalName}></Person>;
    }
    
    0 讨论(0)
提交回复
热议问题