0

So I have this code in my LWC

 const passRecId = new CustomEvent( 'passrecordid', { detail : recordId });

and I have this code on my aura (parent)

getUserRecordId : function(component,event,helper){
    let param = event.getParam('recordId');
    console.log('param2', param);
},

the console.log is getting triggered so that means that is is actually getting received by the parent component. But the param is undefined. Anything I am doing wrong? Maybe I am just missing something out

2
  • Shouldn't you retrieve detail?
    – Adrian Larson
    Commented Jan 31, 2023 at 1:05
  • you mean event.detail?
    – Snorlax
    Commented Jan 31, 2023 at 1:05

1 Answer 1

0

Try this in your lwc

const passRecId = new CustomEvent( 'passrecordid', { detail : {'recordId' : recordId } });

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .