I wrapped an LWC with an Aura component for use it as a quick action and I sent a record's detail from the Aura to the LWC.
AuraWrapper:
<aura:attribute name="orderRecord" type="Object"/>
<aura:attribute name="recordLoadError" type="String"/>
<force:recordData aura:id="recordLoader"
recordId="{!v.recordId}"
fields="A__c, B__c"
targetFields="{!v.orderRecord}"
targetError="{!v.recordLoadError}"
/>
<c:childLwc variableA="{!v.orderRecord.A__c}" variableB="{!v.orderRecord.B__c}"></c:childLwc>
I need to use those variables which come from the Aura parent to filter child component's (LWC) initial data but they aren't available in connectedCallback and renderedCallback's first call.
If I try to access them -let's say a function which is invoked by button click- they are available.
LWC Child:
@api
variableA;
@api
variableB;
connectedCallback(){
// variableA and variableB aren't available at this point so filter not works
this.loadInitDataByFilters(this.variableA, this.variableB);
}
handleClick(){
// variableA and variableB are available at this point so filter works
this.loadDataByFilters(this.variableA, this.variableB);
}
How can I use those variables on initial data population process?