A and B are two best practices when it comes to Lightning Web Component events.
A. Use event.detail to communicate data to elements in the same shadow tree. This is a good practice because the detail property is a JavaScript object that can be used to communicate complex data between components.
B. Use CustomEvent to pass data from a child to a parent component. CustomEvent is a good practice because it allows a child component to communicate with its parent component. By using CustomEvent, the child component can send a message to the parent component with any data it needs to share.
I don't think A is correct - based on this source: https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.events_best_practices
it says: "To communicate data to elements that aren’t in the same shadow tree, use event.detail. " It also says "Use events configured with bubbles: false and composed: false because they're the least disruptive." Meaning D is correct. I think the correct answer is BD
B C
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.events_best_practices
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/events_create_dispatch
upvoted 1 times
...
This section is not available anymore. Please use the main Exam Page.CRT-450 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
govosen887
1 year, 2 months agoDonAldos
1 year, 2 months agobriccoli11
11 months, 2 weeks agoAppleDash
1 year, 5 months agoAppleDash
1 year, 5 months ago