function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
srinath vallabsrinath vallab 

How to pass parameters while navigating from lwc to lightning component?

As we know we navigate from lightning component to lightning component using force:navigateToComponent event along with parameters.
Below is sample code to navigate.
var evt = $A.get("e.force:navigateToComponent"); evt.setParams({ componentDef : "c:myComponent", componentAttributes: { contactName : component.get("<some attribute>") } }); evt.fire();

And we can navigate from lwc to lightning component using below code:
this[NavigationMixin.Navigate]({ "type": "standard__component", "attributes": { "componentName": "c__NavigationDemoComponent" } });

In the second code snippet(from lwc to lightning), how can i pass parameter?
Ankit RathorAnkit Rathor
Hi srinath,

I have done walkthrough of your code, it seems like that have solved same problem before.

Please have a look on the below referance and let me know if you will face or it will not help you.

https://developer.salesforce.com/forums/ForumsMain?id=9062I000000IMNBQA4


If this solution is helpful then please mark it as Best Answer.

Thanks,
Ankit Rathor