@paypal/paypal-js
    Preparing search index...

    Type Alias CardFieldComponent

    CardFieldComponent: HTMLElement & { destroy(): void }

    Type Declaration

    • destroy: function
      • Use this method to destroy the Card Field component and clean up any associated resources. After calling this method, the Card Field component will no longer be usable.

        Returns void

        const numberField = cardFieldsInstance.createCardFieldsComponent({
        type: "number",
        placeholder: "Enter a number",
        });
        document
        .querySelector("#paypal-card-fields-number-container")
        .appendChild(numberField);

        // Later, when you want to clean up:
        numberField.destroy();