ExamGecko
Question list
Search
Search

Question 189 - Certified B2B Commerce Developer discussion

Report
Export

A developer is attempting to write a Lightning Web component from scratch by first creating the HTML markup and receives an error. Which three tags when used as the first element in the file would produce an error?

A.
<template>
Answers
A.
<template>
B.
<article>
Answers
B.
<article>
C.
<body>
Answers
C.
<body>
D.
<html>
Answers
D.
<html>
Suggested answer: B, C, D

Explanation:

In a Lightning Web Component's HTML file, using , <body>, or <html> as the first (root) element would produce an error because the LWC framework requires <template> as the root tag. The <template> tag is necessary for defining the component's structure and supports the framework's reactive and rendering capabilities. The use of other HTML tags as the root element is not supported and will result in an error during component compilation or runtime. Refer to the Salesforce LWC documentation for proper component structure: Salesforce LWC Component Structure Documentation.

asked 23/09/2024
frederic dohen
36 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first