magento2 – How do I add a new JS function via mixin to the Magento checkout payment page’s shipping information section?

I am trying to add a mixin in Magento 2 for the checkout/payment page shipping info section.

There is an existing section in vendor/magento/module-checkout/view/frontend/web/template/shipping-information/address-renderer/default.html as follows:

<each args="data: address().customAttributes, as: 'element'">
   <text args="$parent.getCustomAttributeLabel(element)"/>

I want to create a myNewFunction() and call it from here. So, I have temporarily added if="$parent.myNewFunction(element)" to it, like this:

<each args="data: address().customAttributes, as: 'element'">
   <text if="$parent.myNewFunction(element)" args="$parent.getCustomAttributeLabel(element)"/>

That pre-existing function getCustomAttributeLabel is defined in vendor/magento/module-checkout/view/frontend/web/js/view/shipping-information/address-renderer/default.js.

This is where I need to add my myNewFunction() at. I don’t want to override that entire file and duplicate it into my theme, so I am trying to add the function to it via mixin.

To do this, I have stubbed out a module: app/code/MyCompany.

In this module, I have created:


with this code:

var config = {
    config: {
        mixins: {
            'Magento_Checkout/js/view/shipping-information/address-renderer/default': {
                'MyCompany_Checkout/js/view/shipping-information/address-renderer/default-mixin': true

Then I created the mixin itself in:


with this code:

), function (Component, _, customerData) {
    'use strict';

    return function (target) {
        return target.extend({
            myNewFunction: function (element) {
                return false;

I currently have deploy mode set to “development” in Magento. Nonetheless, I have tried removing all the var/* files, generating static content again, and clearing the cache, for good measure.

No matter what, upon loading the checkout/payment page, I keep getting this JS error in the console:

$parent.myNewFunction is not a function

What am I doing wrong here?

I suspected the module needs to have a register.php? Or the module is not loading? Yet, I have seen plenty of other examples such as this guide, this Magento mixin stackoverflow question, and this example on how to add shipping.js functionality via mixin, none of which mention doing anything more with the module other than declaring the requirejs-config.js and the mixin JS file itself.