Antom, leading provider of tailored payment solutions

element.updateConfig()

Use this method to update the configuration of the Element. After calling element.updateConfig(), the Element will re-render based on the new configuration without needing to recreate the instance.

Notes:

  • This method supports performing a partial update. It only updates the passed parameters while keeping other configurations unchanged.
  • This method is not applicable to CVVElement.

Method signature

When calling this method, please use the following standard method signature format.

javascript
element.updateConfig(newConfig)
typescript
element.updateConfig(newConfig: Partial<VaultingAppConfig>): void

Parameters

Parameter

Data type

Required

Description

newConfig 

Object

Yes

The configuration object used to update the Element.

Note: Currently, this method only supports updating the configuration of VaultingElement. However, dynamic updates to sessionData is not supported.

Return value

This method does not return any value.

Best practices

  • Re-rendering: After updating the configuration, the Element will automatically re-render, and buyers may see interface changes.
  • Calling timing: It is recommended to call element.updateConfig() after the Element is mounted. If called before mounting, the updated configuration will take effect upon mounting.
  • Theme switching: When dynamically switching themes, the Element will retain data already entered by the buyer and only update the styles.