How to use the @microsoft/teams-js.registerOnThemeChangeHandler function in @microsoft/teams-js

To help you get started, we’ve selected a few @microsoft/teams-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OfficeDev / msteams-ui-components / gh-pages / src / index.tsx View on Github external
componentDidMount() {
    this.updateTheme(this.getQueryVariable('theme'));
    this.setState({
      fontSize: this.pageFontSize(),
    });

    if (this.inTeams()) {
      microsoftTeams.initialize();
      microsoftTeams.registerOnThemeChangeHandler(this.updateTheme);
    }
  }
github OfficeDev / TrainingContent / Teams / 04 Fundamentals of Microsoft Teams / Demos / 03-tab-graph / solution / src / app / scripts / teamsApp1Tab / TeamsApp1Tab.tsx View on Github external
public componentWillMount() {
    this.updateTheme(this.getQueryVariable("theme"));
    this.setState({
      fontSize: this.pageFontSize()
    });

    if (this.inTeams()) {
      microsoftTeams.initialize();
      microsoftTeams.registerOnThemeChangeHandler(this.updateTheme);
      microsoftTeams.getContext((context) => {
        this.configuration = context.entityId;
        this.groupId = context.groupId;
      });
    } else {
      this.setState({
        graphData: "This is not hosted in Microsoft Teams"
      });
    }
  }
github OfficeDev / TrainingContent / Teams / 04 Fundamentals of Microsoft Teams / Demos / 01-teams-app-yeoman / solution / src / app / scripts / teamsApp1Tab / TeamsApp1Tab.tsx View on Github external
public componentWillMount() {
        this.updateTheme(this.getQueryVariable("theme"));
        this.setState({
            fontSize: this.pageFontSize()
        });

        if (this.inTeams()) {
            microsoftTeams.initialize();
            microsoftTeams.registerOnThemeChangeHandler(this.updateTheme);
            microsoftTeams.getContext((context) => {
                this.setState({
                    entityId: context.entityId
                });
            });
        } else {
            this.setState({
                entityId: "This is not hosted in Microsoft Teams"
            });
        }
    }

@microsoft/teams-js

Microsoft Client SDK for building app for Microsoft hosts

MIT
Latest version published 24 days ago

Package Health Score

95 / 100
Full package analysis

Similar packages