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

sp component base.basecomponent

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

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

BaseComponent class

The base class for client-side components such as BaseClientSideWebPart or BaseExtension.

Signature:

export default abstract class BaseComponent implements ISPEventObserver

Implements: ISPEventObserver

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 BaseComponent class.

Properties

Property Modifiers Type Description
componentId string Returns the component identifier as defined in the component’s associated manifest.
context BaseComponentContext Use the context object to access common services and state associated with the component.
instanceId string A unique identifier for the instance of the component.
isDisposed boolean Returns true if the component has been already disposed.
manifest IClientSideComponentManifest Provides access to the manifest for the client-side component. virtual

Methods

Method Modifiers Description
dispose() Disposes the component.
onDispose() This event method is called at the end of the component's lifecycle. It provides an opportunity to release any associated resources, cancel any outstanding requests, etc. virtual
Clone this wiki locally