exam questions

Exam CRT-450 All Questions

View all questions & answers for the CRT-450 exam

Exam CRT-450 topic 1 question 381 discussion

Actual exam question from Salesforce's CRT-450
Question #: 381
Topic #: 1
[All CRT-450 Questions]

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.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
2683cc2
1 month, 2 weeks ago
Selected Answer: C
LMS for oustide
upvoted 1 times
...
Lshree
1 month, 3 weeks ago
Custom events are ideal for parent-child communication. LMS is the ideal solution for communication between sibling components or components that are not directly related.
upvoted 1 times
...
FungFam
5 months ago
Selected Answer: C
why not C?
upvoted 1 times
...
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago