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

sp webpart base.basewebpart.oninit

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

Home > @microsoft/sp-webpart-base > BaseWebPart > onInit

BaseWebPart.onInit() method

This event method is called when the web part is initialized. virtual

Signature:

protected onInit(): Promise<void>;

Returns:

Promise<void>

Remarks

This API should be overridden to perform long running operations e.g. data fetching from a remote service before the initial rendering of the web part. The loading indicator is displayed during the lifetime of this method. This API is called only once during the lifecycle of a web part.

Clone this wiki locally