Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Plat-Dev-301 Exam - Topic 3 Question 1 Discussion

Posted by Mabel on Jul 20, 2026 at 06:35 PM

Given the following containment hierarchy:

HTML

What is the correct way to communicate the new value of a property named "passthrough" to my-parent-component if the property is defined within my-child-component?

Suggested Answer: C

In Lightning Web Components (LWC), data flows 'down' via properties and 'up' via events. When a child component needs to communicate a change in a property or state to its parent, it must dispatch a CustomEvent. To pass specific data---such as the new value of the passthrough property---along with the event, the developer must use the detail property within the event initialization object.

Option C is the correct syntax. It creates a new CustomEvent named 'passthrough' and assigns the current value of the component's property (this.passthrough) to the detail key. The parent component can then listen for this event (using onpassthrough={handleEvent}) and access the value via event.detail. Option A is incorrect because it wraps the variable in quotes, passing the literal string 'this.passthrough' instead of the actual data. Option B creates an event but fails to include the data payload, meaning the parent would know an event occurred but wouldn't receive the new value. Option D uses incorrect syntax for event naming and variable referencing. Using the standard CustomEvent constructor with the detail property is the platform-standard way to ensure robust, typed data communication between component layers in the Shadow DOM.

==========


Get Premium Plat-Dev-301 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
12 comments · newest first
JO
Jolene 1 month ago
Option A seems okay too, but it uses a string instead of the value.
LA
Lashunda 1 month ago
I agree! C makes sense. We need the detail.
MA
Marva 1 month ago
I think option C is the best choice. It sends the actual value.
IS
Isadora 2 months ago
B doesn't send any data, so it's not useful at all.
AI
Aileen 2 months ago
C makes the most sense, but is it really that straightforward?
EA
Earleen 2 months ago
Wait, why would you use $passthrough in D? Seems off.
NE
Nell 2 months ago
Definitely agree with C, it passes the value correctly.
SH
Shenika 2 months ago
I think option C is the right choice.
DO
Dominic 2 months ago
I’m leaning towards option A, but I’m not confident that 'this.passthrough' is the right way to reference the property.
WI
Willard 3 months ago
I feel like I might have seen a question similar to this in practice, but I can't recall if the detail should be the property itself or just a string.
AL
Alida 3 months ago
I think option C looks familiar since it includes the detail, which is often necessary to pass data.
MO
Mona 3 months ago
I remember we discussed how to use CustomEvent to communicate between components, but I'm not sure about the detail property.
0/2000 characters

Save Cancel