SPFX Life cycle
SPFx webpart method execution order:
When loading the web part on a page, the methods are fired in the following order:
1) protected onAfterDeserialize(deserializedObject: any, dataVersion: Version): TProperties;
2) protected onInit(): Promise<void>;
3) protected render(): void;
4) protected onBeforeSerialize(): void;
When the web part is removed from a page, the methods are fired in the following order:
1) protected onDispose(): void;
SPFx webpart property pane method execution order:
Opening the property pane:
1) protected loadPropertyPaneResources(): Promise<void>
2) protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration;
3) protected onPropertyPaneRendered(): void;
4) protected onPropertyPaneConfigurationStart(): void;
Updating the properties in the property pane:
When in reactive mode, if any property is changed, the methods are fired in the following order:
1) protected onPropertyPaneFieldChanged(propertyPath: string, oldValue: any, newValue: any): void;
2) protected render(): void;
3) protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration;
4) protected onPropertyPaneRendered(): void;
5) protected onPropertyPaneConfigurationComplete(): void;
When in non-reactive mode, if any property is changed, the methods are fired in the following order:
1) protected onPropertyPaneFieldChanged(propertyPath: string, oldValue: any, newValue: any): void;
2) protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration;
3) protected onPropertyPaneRendered(): void;
When in non-reactive mode, after clicking on the "Apply" button, the methods are fired in the following order:
1) protected onAfterPropertyPaneChangesApplied(): void;
2) protected render(): void;
3) protected onPropertyPaneConfigurationComplete(): void;
4) protected onPropertyPaneRendered(): void;
When the property pane is closed by clicking on the "X" button
1) protected onPropertyPaneConfigurationComplete(): void;
Comments
Post a Comment