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?
In a Lightning Web Component's HTML file, using<article>,<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.
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit