WebPartContext class

Web part context object. This object contains the contextual services available to a web part. e.g. a contextual instance to the http client.

Extends
BaseWebPartContext

Remarks

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the WebPartContext class.

Properties

domElement

Reference to the DOM element that hosts this client-side component.

microsoftTeams

Contextual information about the current Microsoft Teams tab. This object will only be defined if a component is being hosted in Microsoft Teams.

sdks

Conditional set of SDKs provided by SPFx dependent on the environment.

statusRenderer

Web part status renderer.

Property Details

domElement

Reference to the DOM element that hosts this client-side component.

readonly domElement: HTMLElement;

Property Value

HTMLElement

microsoftTeams

Warning

This API is now obsolete.

  • This function has been deprecated

Contextual information about the current Microsoft Teams tab. This object will only be defined if a component is being hosted in Microsoft Teams.

readonly microsoftTeams: typeof microsoftTeams | undefined;

Property Value

typeof microsoftTeams | undefined

Remarks

For more information, please see: https://docs.microsoft.com/en-us/javascript/api/@microsoft/teams-js/?view=msteams-client-js-latest

sdks

Conditional set of SDKs provided by SPFx dependent on the environment.

readonly sdks: ISDKs;

Property Value

statusRenderer

Web part status renderer.

readonly statusRenderer: IClientSideWebPartStatusRenderer;

Property Value

IClientSideWebPartStatusRenderer