Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp component base.basecomponentcontext

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-component-base > BaseComponentContext

BaseComponentContext class

The base class for context objects for client-side components.

Signature:

declare abstract class BaseComponentContext implements IDisposable

Implements: IDisposable

Remarks

A "context" object is a collection of well-known services and other objects that are likely to be needed by business logic that interacts with a associated component. Each component type has its own specialized subclass of BaseComponentContext, e.g. WebPartContext for web parts, ExtensionContext for client-side extensions, and so on.

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

Properties

Property Modifiers Type Description
aadHttpClientFactory AadHttpClientFactory The instance of AadHttpClientFactory created for this instance of component
aadTokenProviderFactory AadTokenProviderFactory The instance of AadTokenProviderFactory created for this instance of component
dynamicDataProvider DynamicDataProvider Returns the Dynamic Data Provider associated with the component.
dynamicDataSourceManager DynamicDataSourceManager Returns the Dynamic Data Source Manager associated with the component.
httpClient HttpClient The instance of HttpClient created for this instance of component
instanceId string A unique identifier for the instance of the component.
isDisposed boolean Returns true if the context is disposed.
manifest IClientSideComponentManifest Manifest for the client-side component.
msGraphClientFactory MSGraphClientFactory The instance of MSGraphClientFactory created for this instance of component
pageContext PageContext The page context provides standard definitions for common SharePoint objects that need to be shared between the client-side application, web parts, and other components.
serviceScope ServiceScope The associated ServiceScope for this component.
spHttpClient SPHttpClient The instance of SpHttpClient created for this instance of component

Methods

Method Modifiers Description
dispose() Disposes the base component context.
Clone this wiki locally