Home > widget-integration > CustomizationCompatibility > afterRender
CustomizationCompatibility.afterRender() method
Executes legacy afterRender customization hooks for a rendered block.
Invokes both general and block-type-specific afterRender callbacks if configured. The general hook runs first, followed by the type-specific hook. Both are optional.
Signature:
afterRender(blockId: string, blockType: string): void;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
blockId |
string |
The unique identifier of the rendered block (e.g., 'boost-sd-widget-homepage-1') |
|
blockType |
string |
The type of block rendered (e.g., 'recommendation', 'search', 'filter') |
Returns:
void
Remarks
This method is called automatically after widget rendering and should not be called directly unless implementing custom rendering logic. Hooks are executed synchronously in the order: general → type-specific.
Example
Usage in custom controller:
protected afterWidgetRender() {
super.afterWidgetRender();
const blockId = this.props?.value.widgetId;
if (blockId) {
this.customizationCompatibility.afterRender(blockId, 'recommendation');
}
}