If I have 5 different lightning components in my lightning page, how do they load? Are they all loading at the same time, asynchronsouly?
Is there a way to control which loads first, second, third, etc...?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
Starting from the documentation, the general idea is that the app container is loaded first, parent components are loaded next, then child components are recursively loaded back up to the parent components. As far as initialization goes, children are initialized before their parents, but after attribute propagation. Aside from ordering your source code, there's no way to control markup-generated component initialization. If you want to control the order better, you could use $A.createComponents to encourage a specific load order, but this has performance implications. Also note that aura:if renders asynchronously as well, so using aura:if can result in other components loading out of order.