I'm wondering is there any technique or pattern that I can use to prioritizing the oninit call?

I have main component (MAIN.cmp) and within it I have few other components Child1.cmp, Child2.cmp and Child2.cmp so what I want is once the page loads I want the MAIN.cmp onInit to load first before it goes to the child.cmp.

How would you go after this? any ideas

1 Answer 1


You cannot directly control the order of aura:valueInit for components purely in markup (see the docs, it demonstrates that children always init before their parents). If you want to control the order, you could use aura:if to delay rendering the children until the parent is done, or you can dynamically create the components in the parent's init handler.

  • I'm interested to know how you do in the aura:if to delay rendering the children until the parent is done and I have tried to create a variable in the aura component and set to true in the parent onInit controller but that's not working as expected, still loading the child first then parent.
    – Nick
    Jul 17, 2020 at 23:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.