Would it be best practice to use only one @wire getRecord in the top-level component and then pass the subsequent data around? or is it okay to use @wire getRecord in all components and instead just pass the recordId around?
PARENT COMPONENT JS:
@api recordId;
_error;
@wire(getNewestMergeId, { })
wireNewestMergeId({ error, data }){
if (data) {
this.recordId = data;
this._error = undefined;
} else if (error) {
this._error = error;
this.recordId = undefined;
} else {
this._error = undefined;
this.recordId = undefined;
}
}
@wire(getRecord, { recordId: '$recordId', fields: [ID_FIELD, NAME_FIELD, STATUS_FIELD] })
_merge;
PARENT COMPONENT HTML
<template>
<div class="slds-grid slds-gutters_xx-small">
{_mergeStatus}
<div class="slds-col slds-size_2-of-3">
<c-bulk-merge-primary-container merge={_merge}></c-bulk-merge-primary-container>
</div>
<div class="slds-col slds-size_1-of-3">
<c-bulk-merge-secondary-container merge={_merge}></c-bulk-merge-secondary-container>
</div>
</div>
</template>