问题
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