You need to sign in to do that
Don't have an account?
Dheeraj shokeen
Grant parent - Parent - Child in LWC Code, howz the logic Implement
A - Grant Parent
B-Parent
C- Child
Is there any logic to direclty
Grand parent send the record to child
B-Parent
C- Child
Is there any logic to direclty
Grand parent send the record to child
In Lightning Web Component (LWC), you can communicate between components using events. To implement the logic where the grandparent sends a record to the child component, you need to follow these steps:
Define an event in the child component (C) that will receive the record from the grandparent component (A): Define an event in the parent component (B) that will receive the record from the grandparent component and pass it to the child component: In the grandparent component (A), fire the event and pass the record to the parent component: In the above code, the grandparent component fires the recordselected event, which is handled by the parent component. The parent component then assigns the received record to its record property. Finally, the child component receives the record from the parent component by setting the record attribute using the @api decorator.
If this helps , please mark this as Best Answer.
Thank you.