Skip to content

Commit b29bc0d

Browse files
authored
chore(compiler-core): define child if necessary. (#2033)
1 parent 09a939d commit b29bc0d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/compiler-core/src/transform.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,8 @@ export function transform(root: RootNode, options: TransformOptions) {
287287
function createRootCodegen(root: RootNode, context: TransformContext) {
288288
const { helper } = context
289289
const { children } = root
290-
const child = children[0]
291290
if (children.length === 1) {
291+
const child = children[0]
292292
// if the single child is an element, turn it into a block.
293293
if (isSingleElementRoot(root, child) && child.codegenNode) {
294294
// single element root is never hoisted so codegenNode will never be

0 commit comments

Comments
 (0)