QuestionQ87

VerifiedBasic Lightning Web Component Development

A developer is creating a custom Lightning Web Components (LWC) component with a grandchild component that must pass information to the grandparent component. Which approach correctly demonstrates passing a message from the grandchild component to the grandparent component?

Explanation

Lightning Web Components use custom events to communicate upward through the component containment hierarchy. The grandchild dispatches a custom event, optionally placing the message in its detail property, and the grandparent handles that event after it propagates upward. Event propagation must be configured appropriately when the event needs to cross component shadow boundaries.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!