A developer created a weather app that contains multiple Lightning web components that are in different DOM trees. One of the components, called Toggle, has a toggle for Fahrenheit or Celsius units. Another component, called Temperature, displays the current temperature in the unit selected in the Toggle component. When a user toggles from Fahrenheit to Celsius or vice versa in the Toggle component, the information must be sent to the…

QuestionsCategory: CRT-450A developer created a weather app that contains multiple Lightning web components that are in different DOM trees. One of the components, called Toggle, has a toggle for Fahrenheit or Celsius units. Another component, called Temperature, displays the current temperature in the unit selected in the Toggle component. When a user toggles from Fahrenheit to Celsius or vice versa in the Toggle component, the information must be sent to the…
Admin Staff asked 4 months ago
A developer created a weather app that contains multiple Lightning web components that are in different DOM trees.
One of the components, called Toggle, has a toggle for Fahrenheit or Celsius units. Another component, called Temperature, displays the current temperature in the unit selected in the Toggle component.
When a user toggles from Fahrenheit to Celsius or vice versa in the Toggle component, the information must be sent to the Temperature component so the temperature can be converted and displayed.
What is the recommended way to accomplish this?

A. Create a custom event to handle the communication between components.

B. The Toggle component should call a method in the Temperature component.

C. Use Lightning Message Service to communicate between the components.

D. Use an application event to communicate between the components.








 

Suggested Answer: A

Community Answer: C



This question is in CRT-450 Salesforce Certified Platform Developer I Exam
For getting Salesforce Certified Platform Developer I











Disclaimers:
The website is not related to, affiliated with, endorsed or authorized by Salesforce. 
Trademarks, certification & product names are used for reference only and belong to Salesforce.
The website does not contain actual questions and answers from Salesforce's Certification Exams.

Recommended

Welcome Back!

Login to your account below

Create New Account!

Fill the forms below to register

Retrieve your password

Please enter your username or email address to reset your password.