Salesforce Platform Developer I (legacy) — Question 122

What are two best practices when it comes to Lightning Web Component events? (Choose two.)

Answer options

Correct answer: B, D

Explanation

Option B is correct because CustomEvent is specifically designed for passing data from a child to a parent component in Lightning Web Components. Option D is also correct as configuring events with bubbles: false and composed: false limits their propagation, which is a best practice in certain scenarios. Options A and C are incorrect because they do not align with best practices for event handling in Lightning Web Components.