How to use MgtTeamsChannelPicker in React?

三世轮回 提交于 2020-07-09 19:57:11

问题


I imported all necessary libs.

import "@microsoft/mgt";
import "@microsoft/teams-js"

put tag MgtTeamsChannelPicker into my render section

render() {
  return (
    <MgtTeamsChannelPicker></MgtTeamsChannelPicker>    
  );
}

than i got an error.


回答1:


Due to how react handles custom elements, they must be referenced differently. Alternatively you can use our wrapper here:

https://github.com/nmetulev/mgt-react

which will allow you to reference the component in the following way:

import { TeamsChannelPicker } from 'mgt-react';
<TeamsChannelPicker></TeamsChannelPicker>

quick note: The names of the React components are in PascalCase and do not include the Mgt prefix



来源:https://stackoverflow.com/questions/61979265/how-to-use-mgtteamschannelpicker-in-react

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!