pageInit and sub-components

I’ve run into this situation in another instance that I can’t recall at the moment, but when declaring sub-components with JSX in core, it seems like they’re not necessarily initialized when page:init fires.

In this case, I’m trying to use a preloader within sub-component which is a sheet modal. Preloaders initialize themselves off of the pageInit event, so it’s not properly initializing within the sub-component because it doesn’t find the element.

I’m having to do this as a work-around within onUpdated:

if (thisPage && !preloaderInit) {
    thisPage.$el.find('.preloader').each((preloaderEl) => {
        preloaderInit = true;

I’m not sure if this is an expected limitation or if I’m just misusing the sub-components in some way.

Interesting, but can you give a more complete example so I can check/replicate the issue?