Re-using a custom component

Hi Owen,

Native Libraries are inherited across app dependencies, but right now the assets are not. That means that you will need to duplicate whatever function is defined in the assets of your custom component app, but you won’t need to duplicate the set of native libraries added there. This is something we’re working on, and app assets will be inherited properly in a future update.

Of course, remember that the Native Libraries feature just injects code into the <head> element of the page. So there’s nothing to stop you writing something like this:

<script>
    function foo() {
        return 42;
    }
</script>

The global function foo will then be available in both this app and its dependencies. You could also include the required JS function directly in the HTML of the Custom Component.

I hope that gives you enough to work around the lack of inheritance of assets for now!