1

I'm trying to run a method in my child component (LWC component) from my parent component (Aura Component) but the method is never run.

Parent (Aura Helper)

    const months = component.find("month");
    for(let i=0; i < months.length; i++){
        months[i].getAllDays();   
    }

Child (Aura)

    @api
    getAllDays(){
        console.log('Check');
    }

The components "month" are found. I can get attributes if I do:

months[i].get("v.myVar");

I can't run exposed functions. Have you any ideas ?

EDIT

The problem is that my parent component initialization is faster than my child component loading and it can't run the function. My syntax is good

  • Hi, welcome to SFSE. Please take a tour and read How to Ask. Can you provide some more code of your problem, like HTML files of your components? – Przemysław Tamoń Mar 27 at 15:05
  • Removed my answer, as it wasn't useful. – Caspar Harmer Apr 1 at 21:05
1

The problem is that my parent component initialization is faster than my child component loading and it can't run the function. My syntax is good

| improve this answer | |

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.